Commit b29a3e6
authored
test(CI): fix test_extension_ci failures across all PHP versions (#3663)
* test(CI): fix bug in request replayer
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
* fix(tests): filter remote config requests from CLI trace retrieval
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].
* test(CI): fix pnctl tests
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
* test(CI): fix crashtracking disabled test
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
* test(CI): use try/catch in crashtracker_disabled test to avoid STDERR 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).
* test(CI): use EXPECTF with %A to handle Segmentation fault output
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.
* test(CI): fix EXPECTF pattern for crashtracker_segfault_disabled
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'
* test(CI): use previous request-replayer version
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
---------
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>1 parent f785afe commit b29a3e6
File tree
3 files changed
+14
-5
lines changed- .gitlab
- tests/Common
3 files changed
+14
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
79 | 85 | | |
80 | 86 | | |
81 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
538 | | - | |
539 | | - | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
540 | 541 | | |
541 | 542 | | |
542 | 543 | | |
| |||
566 | 567 | | |
567 | 568 | | |
568 | 569 | | |
569 | | - | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
570 | 573 | | |
571 | 574 | | |
572 | 575 | | |
| |||
0 commit comments