test(CI): fix test_extension_ci failures across all PHP versions#3663
test(CI): fix test_extension_ci failures across all PHP versions#3663
Conversation
|
✨ Fix all issues with BitsAI or with Cursor
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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.
🚀 New features to boost your workflow:
|
5cc9048 to
ac3806e
Compare
ac3806e to
7f0d314
Compare
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
7f0d314 to
fb13815
Compare
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].
9f2d731 to
cb1ff2a
Compare
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
cb1ff2a to
79495cd
Compare
2a5e766 to
b29a403
Compare
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
b29a403 to
90d7f50
Compare
… 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>
Description
Fixes
test_extension_ciCI 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 aTypeErrorinflattenTraces().Fix:
retrieveDumpedTraceData()andgetAgentRequestFromCommand()now filter for requests with URIs starting with/v0.4/tracesor/v0.7/traces.crashtracker_segfault_disabled.phpttimeoutsA newer request-replayer image added file I/O to the
/v0.7/confighandler. Since PHP's built-in web server is single-threaded, continuous remote config polls from parallel CI workers slowed/replayresponses enough to cause thewaitForRequest()loop to exceedrun-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