Skip to content

Comments

test(CI): fix test_extension_ci failures across all PHP versions#3663

Merged
Leiyks merged 8 commits intomasterfrom
leiyks/fix-ci
Feb 21, 2026
Merged

test(CI): fix test_extension_ci failures across all PHP versions#3663
Leiyks merged 8 commits intomasterfrom
leiyks/fix-ci

Conversation

@Leiyks
Copy link
Contributor

@Leiyks Leiyks commented Feb 19, 2026

Description

Fixes test_extension_ci CI failures across PHP 7.0–8.5 introduced by the sidecar race-condition fix and a request-replayer image update.

Remote config requests polluting the trace dump

After the sidecar race-condition fix, remote config polls (/v0.7/config) now arrive in the request-replayer dump before the actual trace. getAgentRequestFromCommand() was taking index [0], which could be a config payload, causing a TypeError in flattenTraces().

Fix: retrieveDumpedTraceData() and getAgentRequestFromCommand() now filter for requests with URIs starting with /v0.4/traces or /v0.7/traces.

crashtracker_segfault_disabled.phpt timeouts

A newer request-replayer image added file I/O to the /v0.7/config handler. Since PHP's built-in web server is single-threaded, continuous remote config polls from parallel CI workers slowed /replay responses enough to cause the waitForRequest() loop to exceed run-tests.php's process timeout.

Fix: Pin the request-replayer image to the previous SHA (4f26c11d...). The request-replayer I/O issue will be addressed in a follow-up PR.

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Feb 19, 2026

⚠️ Tests

Fix all issues with BitsAI or with Cursor

⚠️ Warnings

🧪 1028 Tests failed

    testSearchPhpBinaries from integration.DDTrace\Tests\Integration\PHPInstallerTest (Fix with Cursor)

    testSimplePushAndProcess from laravel-58-test.DDTrace\Tests\Integrations\Laravel\V5_8\QueueTest (Fix with Cursor)

testSimplePushAndProcess from laravel-8x-test.DDTrace\Tests\Integrations\Laravel\V8_x\QueueTest (Datadog) (Fix with Cursor)
DDTrace\Tests\Integrations\Laravel\V8_x\QueueTest::testSimplePushAndProcess
Test code or tested code printed unexpected output: spanLinksTraceId: 6998f95200000000bb04bb597e607947
tid: 6998f95200000000
hexProcessTraceId: bb04bb597e607947
hexProcessSpanId: b98c831b68e62d52
processTraceId: 13476101978046101831
processSpanId: 13370205547503430994
View all

ℹ️ Info

❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 003b6bd | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@codecov-commenter
Copy link

codecov-commenter commented Feb 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.20%. Comparing base (a9caaa0) to head (003b6bd).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3663      +/-   ##
==========================================
- Coverage   62.21%   62.20%   -0.02%     
==========================================
  Files         141      141              
  Lines       13387    13387              
  Branches     1753     1753              
==========================================
- Hits         8329     8327       -2     
- Misses       4260     4263       +3     
+ Partials      798      797       -1     

see 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a9caaa0...003b6bd. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
The sidecar now reliably connects during CLI subprocess lifetime
(after the race condition fix), causing remote config polls to
land in the request-replayer dump before the actual trace request.

getAgentRequestFromCommand() was taking the first non-telemetry
request from the dump, which could be a /v0.7/config remote config
request instead of a trace. This caused flattenTraces() to receive
the remote config payload and fail with a TypeError when iterating
over span data.

Fix: filter for the first actual trace request (uri starting with
/v0.4/traces or /v0.7/traces) instead of taking [0].
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
@Leiyks Leiyks dismissed jorgetomtz’s stale review February 20, 2026 13:14

Image has been updated

@Leiyks Leiyks force-pushed the leiyks/fix-ci branch 3 times, most recently from 2a5e766 to b29a403 Compare February 20, 2026 17:04
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
… dependency

Different PHP versions ship different run-tests.php implementations with
different STDERR handling. Some versions don't include STDERR in the
comparison buffer, causing the Fatal error message to be missed.

Use try/catch to explicitly echo the timeout message to STDOUT so the
EXPECT section matches reliably across all PHP versions.

Also revert request-replayer image tag back to 2.0 (not 2.0-debug).
system() outputs "Segmentation fault (core dumped)" to stdout from the
shell when the child process dies with SIGSEGV. Use EXPECTF with %A
wildcards so the pattern matches regardless of this extra output, while
still reliably matching "wait for replay timeout" from the try/catch.
The EXPECTF pattern '%Await for replay timeout\n%A' generates the regex
'^.*wait for replay timeout\n.*$'. However run-tests.php trims the test
output, so there is no trailing newline and the \n after 'timeout'
never matches.

Remove the trailing '%A' line so the regex becomes '^.*wait for
replay timeout$' which matches the trimmed output:
'Segmentation fault (core dumped)\nwait for replay timeout'
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
@Leiyks Leiyks changed the title test(CI): fix bug in request replayer test(CI): fix test_extension_ci failures across all PHP versions Feb 21, 2026
@Leiyks Leiyks added the ci label Feb 21, 2026
@Leiyks Leiyks marked this pull request as ready for review February 21, 2026 00:08
@Leiyks Leiyks requested a review from a team as a code owner February 21, 2026 00:08
@Leiyks Leiyks merged commit b29a3e6 into master Feb 21, 2026
2067 of 2070 checks passed
@Leiyks Leiyks deleted the leiyks/fix-ci branch February 21, 2026 00:28
@github-actions github-actions bot added this to the 1.17.0 milestone Feb 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants