From 6da41623ad2d1c8ba3e1d6e49bf6edaafcdad04b Mon Sep 17 00:00:00 2001 From: Alexandre Rulleau Date: Fri, 5 Jun 2026 14:28:40 +0200 Subject: [PATCH 1/2] fix(ci): silence sidecar flush timeout log noise in client_side_stats test [test_extension_ci] Under concurrent run-tests load the best-effort dd_trace_synchronous_flush() can exceed its 5s window, emitting '[ddtrace] [error] Failed synchronously flushing traces: Kind(TimedOut)' on stderr. The stats still arrive via the async sidecar path that the test polls with waitForStats(), so the expected output is produced, but the stray error line breaks the output diff. Set DD_TRACE_LOG_LEVEL=off to match the sibling tests (client_side_stats_peer_tags, client_side_stats_trace_filters), which already suppress this benign log noise. --- tests/ext/request-replayer/client_side_stats.phpt | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ext/request-replayer/client_side_stats.phpt b/tests/ext/request-replayer/client_side_stats.phpt index 3e20b8a6cc4..ee448cbeabc 100644 --- a/tests/ext/request-replayer/client_side_stats.phpt +++ b/tests/ext/request-replayer/client_side_stats.phpt @@ -27,6 +27,7 @@ DD_TRACE_GENERATE_ROOT_SPAN=0 DD_INSTRUMENTATION_TELEMETRY_ENABLED=0 DD_TRACE_SIDECAR_TRACE_SENDER=1 DD_TRACE_STATS_COMPUTATION_ENABLED=1 +DD_TRACE_LOG_LEVEL=off --INI-- datadog.env=test-env datadog.version=1.2.3-basic From ba019ca807560e93751af76ac3d4d15b0326edd2 Mon Sep 17 00:00:00 2001 From: Alexandre Rulleau Date: Fri, 5 Jun 2026 22:38:00 +0200 Subject: [PATCH 2/2] fix(ci): harden fargate header and shm_data tests against concurrent flush timing [test_extension_ci] Under concurrent run-tests -j4 load two background-sender/sidecar tests flaked because best-effort flushing to the shared request-replayer can be delayed beyond their wait windows: - agent_headers_container_id_fargate.phpt threw 'wait for replay timeout': its DD_TRACE_AGENT_FLUSH_INTERVAL=333 gives a ~16s replay-poll window (maxIteration * flushInterval), half that of the reliably-passing sibling agent_headers_container_id.phpt (666). Bump to 666 to match the sibling and double the window the BGS delivery can use under load. - shm_data_internal_fns.phpt got 'Failed synchronously flushing traces: Kind(TimedOut)' stderr noise and a missing agent sampling config (bool(false)/float(-1)) because the best-effort synchronous_flush timed out, delaying the trace that makes the replayer return rate_by_service. Set DD_TRACE_LOG_LEVEL=off (same convention as client_side_stats) to silence the benign log line, and re-trigger the flush periodically while polling 100x100ms so the sampling config reliably propagates into SHM. --- .../agent_headers_container_id_fargate.phpt | 2 +- tests/ext/shm_data_internal_fns.phpt | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/ext/background-sender/agent_headers_container_id_fargate.phpt b/tests/ext/background-sender/agent_headers_container_id_fargate.phpt index fa4fccffb7e..9a6dae7a944 100644 --- a/tests/ext/background-sender/agent_headers_container_id_fargate.phpt +++ b/tests/ext/background-sender/agent_headers_container_id_fargate.phpt @@ -9,7 +9,7 @@ DD_TRACE_BGS_ENABLED=1 DD_AGENT_HOST=request-replayer DD_TRACE_AGENT_PORT=80 DD_TRACE_AGENT_FLUSH_AFTER_N_REQUESTS=1 -DD_TRACE_AGENT_FLUSH_INTERVAL=333 +DD_TRACE_AGENT_FLUSH_INTERVAL=666 DD_TRACE_GENERATE_ROOT_SPAN=0 DD_INSTRUMENTATION_TELEMETRY_ENABLED=0 --INI-- diff --git a/tests/ext/shm_data_internal_fns.phpt b/tests/ext/shm_data_internal_fns.phpt index cd85e14ba44..a1b8b3ff3ee 100644 --- a/tests/ext/shm_data_internal_fns.phpt +++ b/tests/ext/shm_data_internal_fns.phpt @@ -34,6 +34,7 @@ DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS=0.1 DD_TRACE_SIDECAR_TRACE_SENDER=1 DD_DYNAMIC_INSTRUMENTATION_ENABLED=1 DD_TRACE_IGNORE_AGENT_SAMPLING_RATES=0 +DD_TRACE_LOG_LEVEL=off --INI-- datadog.service=shm_data_test datadog.env=test @@ -64,9 +65,16 @@ $rr->setResponse(['rate_by_service' => [ dd_trace_internal_fn('synchronous_flush'); // ensure sidecar sends immediately $rr->waitForDataAndReplay(); -for ($i = 0; $i < 50; $i++) { +// Under concurrent run-tests load the best-effort synchronous_flush above can +// time out, delaying delivery of the trace that makes the replayer return the +// sampling rates. Re-trigger the flush periodically and poll generously so the +// agent sampling config eventually propagates into SHM. +for ($i = 0; $i < 100; $i++) { $sampling = dd_trace_internal_fn('get_agent_sampling_config'); if (!empty($sampling)) { break; } + if ($i % 10 === 9) { + dd_trace_internal_fn('synchronous_flush'); + } usleep(100000); } var_dump(is_array($sampling));