Skip to content

Commit dfc13d3

Browse files
profiling: drop parallel ext in language tests instead of xfailing ZTS
The ~56 'ZTS-only' language-test failures were not an upstream PHP quirk: they are caused by the parallel extension (loaded only on the ZTS build in the CI image), which defers 'PHP Startup' diagnostics until after the script's first output, so deprecation/warning notices land in the wrong place relative to the bundled --EXPECTF--. Remove parallel.ini in run_php_language_tests.sh (alongside rdkafka and memcached; no-op for the tracer NTS debug job where parallel is not loaded), which makes all those tests pass on ZTS. Delete the ZTS-only xfail list and its conditional in generate-profiler.php, restoring full ZTS coverage. Verified 57/57 formerly-failing tests pass on ZTS with the profiler loaded and parallel removed.
1 parent 80e0128 commit dfc13d3

4 files changed

Lines changed: 10 additions & 89 deletions

File tree

.gitlab/generate-profiler.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,5 @@
154154
- echo "extension=/tmp/cargo/profiler-release/libdatadog_php_profiling.so" > /opt/php/${FLAVOUR}/conf.d/profiling.ini
155155
- php -v
156156
- cat "${XFAIL_LIST}" profiling/tests/php-language-xfail.list > /tmp/profiler-php-language-xfail.list
157-
- if [ "${FLAVOUR}" = "zts" ]; then cat profiling/tests/php-language-xfail-zts.list >> /tmp/profiler-php-language-xfail.list; fi
158157
- export XFAIL_LIST=/tmp/profiler-php-language-xfail.list
159158
- .gitlab/run_php_language_tests.sh

.gitlab/run_php_language_tests.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@ set -eo pipefail
44
# Helper to parse version strings for comparison
55
function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
66

7-
# Remove extensions whose mere presence pollutes test output (e.g. rdkafka
8-
# emits CONFWARN lines, breaking Zend/tests/instantiate_all_classes.phpt).
7+
# Remove extensions whose mere presence pollutes test output or output
8+
# ordering:
9+
# - rdkafka emits CONFWARN lines, breaking Zend/tests/instantiate_all_classes.phpt
10+
# - parallel (ZTS-only) defers 'PHP Startup' diagnostics until after the
11+
# script's first output, breaking ~56 deprecation/warning-ordering tests
912
# Derive the scan dir from the active PHP so this works for every build
1013
# variant (debug for the tracer job, nts/zts for the profiler job) instead
1114
# of hardcoding the debug path.
1215
scan_dir="$(php -r 'echo PHP_CONFIG_FILE_SCAN_DIR;')"
1316
sudo rm -f "${scan_dir}/memcached.ini"
1417
sudo rm -f "${scan_dir}/rdkafka.ini"
18+
sudo rm -f "${scan_dir}/parallel.ini"
1519
if [[ ! "${XFAIL_LIST:-none}" == "none" ]]; then
1620
cp "${XFAIL_LIST}" /usr/local/src/php/xfail_tests.list
1721
(

profiling/tests/README.md

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,16 @@
1-
# PHP language test xfail lists
1+
# PHP language test xfail list
22

33
The profiler's "PHP language tests" CI job runs the upstream PHP test suite
44
with the profiling extension loaded, for every supported PHP version and for
5-
both the `nts` and `zts` builds. These lists exclude tests that cannot pass in
6-
that environment for reasons unrelated to profiler correctness.
5+
both the `nts` and `zts` builds. `php-language-xfail.list` excludes tests that
6+
cannot pass in that environment for reasons unrelated to profiler correctness.
77

88
`.gitlab/run_php_language_tests.sh` **deletes** every `.phpt` named in
99
`XFAIL_LIST` before running, so listing a test means "do not run" it.
1010

11-
| File | Applies to |
12-
|------|------------|
13-
| `php-language-xfail.list` | all profiler runs (`nts` + `zts`) |
14-
| `php-language-xfail-zts.list` | ZTS build only (appended by the job) |
15-
16-
ZTS-only failures live in their own list so the NTS build keeps running them.
17-
18-
## `php-language-xfail.list`
19-
20-
Fail with the profiler loaded on both NTS and ZTS:
11+
Tests fail with the profiler loaded on both NTS and ZTS:
2112

2213
- `ext/ffi/tests/list.phpt` — aborts (`free(): invalid size`); allocation
2314
profiler conflicts with the test's FFI memory management.
2415
- `Zend/tests/concat_003.phpt` — perf-sensitive (2 s budget); allocation
2516
profiling overhead can exceed it on CI runners.
26-
27-
## `php-language-xfail-zts.list`
28-
29-
All entries pass on NTS and fail only on ZTS, and reproduce on vanilla ZTS PHP
30-
with no Datadog extension loaded — so none are profiler defects.
31-
32-
Root cause: on ZTS, PHP flushes its `PHP Startup` diagnostics *after* the SAPI
33-
starts emitting request output; on NTS they appear before it. The bundled
34-
`--EXPECTF--` was written for the NTS ordering, so the diff is purely the
35-
position of the startup notice. The tracer language-test job only runs NTS, so
36-
it never hits these.
37-
38-
The relocated diagnostic is either a `Deprecated:` notice (`assert.*`, session
39-
and mbstring INI deprecations, `allow_url_include`, `filter.default`,
40-
`auto_detect_line_endings`, …) or a `Warning:`/`Fatal error:` (`date.timezone`,
41-
invalid mbstring encoding, `session.name`/`upload_progress`, session
42-
save-handler, `zend_test.quantity_value`).

profiling/tests/php-language-xfail-zts.list

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)