Skip to content

fix(ci): restore RC write-mode NULL-swap; fix usleep(float) in agent-env test#3849

Draft
Leiyks wants to merge 1 commit intomasterfrom
leiyks/fix-ci-rc-multiconfig-and-agent-env
Draft

fix(ci): restore RC write-mode NULL-swap; fix usleep(float) in agent-env test#3849
Leiyks wants to merge 1 commit intomasterfrom
leiyks/fix-ci-rc-multiconfig-and-agent-env

Conversation

@Leiyks
Copy link
Copy Markdown
Contributor

@Leiyks Leiyks commented Apr 30, 2026

Summary

Two CI fixes in one PR:

1. ext/remote_config.c — regression from commit 7e215d9

The RC WRITE-mode path was changed from temporarily NULLing remote_config_state to
setting a remote_config_writing bool. This broke multiconfig priority merging on PHP 7.4:
dynamic_config_multiconfig.phpt now returns -1/"true" instead of "0.7"/"1" because
INI values are never committed to PHP's INI system in the WRITE path. Reverting to the
NULL-swap pattern restores the correct behavior.

remote_config_writing is kept in ext/configuration.c and ext/live_debugger.c where
it was needed for live-debugger re-entrancy protection.

2. tests/ext/request-replayer/dd_trace_agent_env.phpt:44 — E_WARNING kills PHP 8.x valgrind pass

usleep(floor(microtime(true) - $start) * 100000) passes a `float` to `usleep()`.
PHP 8 emits `E_WARNING: A non-numeric value encountered`; `run-tests.php` treats this as
fatal and aborts the entire 656-test valgrind pass, causing all `test_extension_ci` jobs
on PHP 8.x to fail. Replaced with `dd_trace_internal_fn('await_agent_info', 15000)` which
correctly waits for agent info to be ready with valgrind-safe headroom.

Test plan

  • test_extension_ci [7.4]dynamic_config_multiconfig.phpt passes
  • test_extension_ci [8.3] — valgrind pass completes without fatal E_WARNING
  • test_extension_ci [8.0] — no regression

…nt-env test

- ext/remote_config.c: revert WRITE-mode path from remote_config_writing bool
  back to the NULL-swap pattern. Commit 7e215d9 introduced a regression where
  dynamic_config_multiconfig.phpt returns default INI values (-1/"true") instead
  of the merged RC values (0.7/"1") on PHP 7.4.

- tests/ext/request-replayer/dd_trace_agent_env.phpt: replace
  usleep(floor(...) * 100000) with dd_trace_internal_fn('await_agent_info', 15000).
  floor() returns float; PHP 8 usleep() expects int, emitting E_WARNING which
  run-tests.php treats as fatal, aborting the entire valgrind test pass.
@datadog-official
Copy link
Copy Markdown

datadog-official Bot commented Apr 30, 2026

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 60.68% (-0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 82ea121 | Docs | Datadog PR Page | Give us feedback!

@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Apr 30, 2026

Benchmarks [ tracer ]

Benchmark execution time: 2026-04-30 13:37:26

Comparing candidate commit 82ea121 in PR branch leiyks/fix-ci-rc-multiconfig-and-agent-env with baseline commit 82abdf3 in branch master.

Found 0 performance improvements and 2 performance regressions! Performance is the same for 189 metrics, 3 unstable metrics.

scenario:MessagePackSerializationBench/benchMessagePackSerialization-opcache

  • 🟥 execution_time [+2.287µs; +2.993µs] or [+2.220%; +2.905%]

scenario:SamplingRuleMatchingBench/benchRegexMatching4

  • 🟥 execution_time [+2.324µs; +2.605µs] or [+14.626%; +16.395%]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant