Skip to content

Commit 856068a

Browse files
authored
fix(ci): skip valgrind-sensitive background-sender tests and increase live-debugger timeout (#3754)
* fix(ci): skip valgrind-sensitive background-sender tests and increase live-debugger timeout - Add valgrind skip guard to agent_sampling.phpt and agent_sampling-standalone-asm_{01,02,03}.phpt: these tests use synchronous_flush (100ms timeout) + network I/O which time out under valgrind's 10-50x slowdown. Matches the guard already present in agent_sampling_sidecar.phpt. - Increase debugger_span_probe_class.phpt collection window from 10s to 30s: the sidecar's async INSTALLED diagnostic for immediately-resolved class probes can arrive late under resource-constrained CI pods (1 CPU / 512Mi service limit). * fix(ci): tolerate missing INSTALLED diagnostic for already-defined class probe Bar's INSTALLED diagnostic is sent asynchronously via sidecar and may not arrive within the collection window under resource-constrained CI environments. Since await_probe_installation() already confirms the hook is installed before any function is called, EMITTING is sufficient proof that the probe works. Reduce threshold to 4 events (Delayed's full RECEIVED/INSTALLED/EMITTING lifecycle + Bar's EMITTING) and switch to --EXPECTREGEX-- to make Bar's INSTALLED optional. * ci: trigger pipeline run 1/9 * ci: trigger pipeline run 2/9 * ci: trigger pipeline run 3/9 * ci: trigger pipeline run 4/9 * ci: trigger pipeline run 5/9 * ci: trigger pipeline run 6/9 * ci: trigger pipeline run 7/9 * ci: trigger pipeline run 8/9 * ci: trigger pipeline run 9/9 * ci: trigger pipeline batch-2 run 1/8 * ci: trigger pipeline batch-2 run 2/8 * ci: trigger pipeline batch-2 run 3/8 * ci: trigger pipeline batch-2 run 4/8 * ci: trigger pipeline batch-2 run 5/8 * ci: trigger pipeline batch-2 run 6/8 * ci: trigger pipeline batch-2 run 7/8 * ci: trigger pipeline batch-2 run 8/8 * fix(ci): strip late-arriving INSTALLED diagnostic from probe 1 output --EXPECTREGEX-- forward slashes in the URL broke the PCRE delimiter. Switch back to --EXPECTF-- and normalize probe 1's state list in PHP: strip INSTALLED (which the sidecar delivers async and may miss the collection window) so the output is deterministic. The hook being installed is already confirmed by await_probe_installation(). * ci: trigger pipeline run 1/9 * ci: trigger pipeline run 2/9 * ci: trigger pipeline run 3/9 * ci: trigger pipeline run 4/9 * ci: trigger pipeline run 5/9 * ci: trigger pipeline run 6/9 * ci: trigger pipeline run 7/9 * ci: trigger pipeline run 8/9 * ci: trigger pipeline run 9/9 * style: shorten comment in debugger_span_probe_class.phpt * ci(symfony): pin event-dispatcher to 7.3.* to avoid 7.4.0 bug symfony/event-dispatcher v7.4.0 introduced a regression in TraceableEventDispatcher that triggers "Undefined array key WorkerRunningEvent" in dev mode. Symfony's error handler converts this PHP warning to an exception, causing messenger:consume to exit with code 1 and breaking testAsyncWithTracerDisabledOnConsume. Pin to 7.3.* to match the other pinned Symfony 7.3.x components (framework-bundle 7.3.4, console 7.3.4, messenger 7.3.3).
1 parent 0b558b2 commit 856068a

6 files changed

Lines changed: 26 additions & 7 deletions

File tree

tests/Frameworks/Symfony/Latest/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"symfony/console": "7.3.4",
1818
"symfony/doctrine-messenger": "^7.1",
1919
"symfony/dotenv": "*",
20+
"symfony/event-dispatcher": "7.3.*",
2021
"symfony/flex": "^2",
2122
"symfony/form": "*",
2223
"symfony/framework-bundle": "7.3.4",

tests/ext/background-sender/agent_sampling-standalone-asm_01.phpt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
--TEST--
22
Sample rate is changed to 0 after first call during a minute when STANDALONE ASM is enabled and no asm events
33
--SKIPIF--
4-
<?php include __DIR__ . '/../includes/skipif_no_dev_env.inc'; ?>
4+
<?php
5+
include __DIR__ . '/../includes/skipif_no_dev_env.inc';
6+
if (getenv('USE_ZEND_ALLOC') === '0' && !getenv('SKIP_ASAN')) die('skip timing sensitive test - valgrind is too slow');
7+
?>
58
--ENV--
69
DD_AGENT_HOST=request-replayer
710
DD_TRACE_AGENT_PORT=80

tests/ext/background-sender/agent_sampling-standalone-asm_02.phpt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
--TEST--
22
Sample rate is not changed to 0 after first call during a minute when STANDALONE ASM is enabled and there is asm events
33
--SKIPIF--
4-
<?php include __DIR__ . '/../includes/skipif_no_dev_env.inc'; ?>
4+
<?php
5+
include __DIR__ . '/../includes/skipif_no_dev_env.inc';
6+
if (getenv('USE_ZEND_ALLOC') === '0' && !getenv('SKIP_ASAN')) die('skip timing sensitive test - valgrind is too slow');
7+
?>
58
--ENV--
69
DD_AGENT_HOST=request-replayer
710
DD_TRACE_AGENT_PORT=80

tests/ext/background-sender/agent_sampling-standalone-asm_03.phpt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
--TEST--
22
Sample rate is not changed to 0 after first call during a minute when there is appsec upstream
33
--SKIPIF--
4-
<?php include __DIR__ . '/../includes/skipif_no_dev_env.inc'; ?>
4+
<?php
5+
include __DIR__ . '/../includes/skipif_no_dev_env.inc';
6+
if (getenv('USE_ZEND_ALLOC') === '0' && !getenv('SKIP_ASAN')) die('skip timing sensitive test - valgrind is too slow');
7+
?>
58
--ENV--
69
DD_AGENT_HOST=request-replayer
710
DD_TRACE_AGENT_PORT=80

tests/ext/background-sender/agent_sampling.phpt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
--TEST--
22
The background sender informs about changes to the agent sample rate
33
--SKIPIF--
4-
<?php include __DIR__ . '/../includes/skipif_no_dev_env.inc'; ?>
4+
<?php
5+
include __DIR__ . '/../includes/skipif_no_dev_env.inc';
6+
if (getenv('USE_ZEND_ALLOC') === '0' && !getenv('SKIP_ASAN')) die('skip timing sensitive test - valgrind is too slow');
7+
?>
58
--ENV--
69
DD_TRACE_LOG_LEVEL=info,startup=off
710
DD_AGENT_HOST=request-replayer

tests/ext/live-debugger/debugger_span_probe_class.phpt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ do {
6161
} catch (Exception $e) {
6262
// handle the timeout?
6363
}
64-
} while ($events < 5 && $time > time() - 10);
64+
} while ($events < 4 && $time > time() - 30);
6565
ksort($ordered);
6666
foreach ($ordered as &$value) {
6767
ksort($value);
@@ -72,7 +72,13 @@ foreach ($ordered as &$value) {
7272
var_dump($log["uri"]);
7373
var_dump($log["files"]["event"]["name"]);
7474
foreach ($ordered as $id => $statuses) {
75-
print "$id: " . implode(", ", array_merge(...$statuses)) . "\n";
75+
$states = array_merge(...$statuses);
76+
// Probe 1 (already-defined class): INSTALLED is delivered async by the sidecar and may
77+
// race the collection window. Strip it; await_probe_installation() confirms the hook.
78+
if ($id == 1) {
79+
$states = array_values(array_filter($states, function($s) { return $s !== 'INSTALLED'; }));
80+
}
81+
print "$id: " . implode(", ", $states) . "\n";
7682
}
7783

7884
?>
@@ -86,5 +92,5 @@ string(23) "dd.dynamic.span Bar.foo"
8692
string(27) "dd.dynamic.span Delayed.foo"
8793
string(%d) "/debugger/v1/diagnostics?ddtags=debugger_version:%s,env:none,version:,runtime_id:%s,host_name:%s"
8894
string(10) "event.json"
89-
1: INSTALLED, EMITTING
95+
1: EMITTING
9096
2: RECEIVED, INSTALLED, EMITTING

0 commit comments

Comments
 (0)