test: stabilize flaky tests - #2256
Conversation
BenchmarksComparisonBenchmark execution time: 2026-07-21 10:41:53 Comparing candidate commit 059df57 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 123 metrics, 0 unstable metrics.
|
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 059df57 | Docs | Datadog PR Page | Give us feedback! |
yannham
left a comment
There was a problem hiding this comment.
If this unblocks, let's merge this 👍
| } | ||
|
|
||
| #[test] | ||
| #[cfg_attr(miri, ignore)] |
There was a problem hiding this comment.
I'm curious, why would miri behave differently wrt to flakiness? Isn't just a red herring (limiting the probability of hitting the issue if we run the test twice as less? Is it a new test that just fails under Miri consistently?
There was a problem hiding this comment.
So I could not repro this. Clanker has theories about the test that could be an issue:
For this specific test:
enumerate_discovers_spawned_threadthe test spawns a thread, receives its TID over a channel, then enumerates /proc/self/task and expects that TID to be present.
The channel guarantees the child thread sent its TID, but it does not necessarily prove that Miri/host /proc view will expose that interpreted thread exactly like a normal native Linux thread at that point. Under Miri, threads are simulated/interpreted, while /proc
is an OS interface. With -Zmiri-disable-isolation, Miri allows more host access, but that does not make every host-observable thread assumption robust.
Artifact Size Benchmark Reportaarch64-alpine-linux-musl
aarch64-unknown-linux-gnu
libdatadog-x64-windows
libdatadog-x86-windows
x86_64-alpine-linux-musl
x86_64-unknown-linux-gnu
|
| with: | ||
| cache-targets: true # cache build artifacts | ||
| cache-bin: true # cache the ~/.cargo/bin directory | ||
| - name: "Clear macOS panic-abort cache" |
There was a problem hiding this comment.
@gyuheon0h this is a workaround, I think we should not be caching this.
|
/merge |
|
View all feedbacks in Devflow UI.
This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
The expected merge time in
|
054402d
into
main
What does this PR do?
Skips one ptrace thread-enumeration test under Miri.
Makes async test assertions wait for the expected request instead of relying on fixed sleeps.
Clears the macOS
target/panic-abortcache before tests as a short-term workaround for stale cached build artifacts.Motivation
These flaky tests and the macOS cache issue are currently blocking builds.
Additional Notes
The macOS cache cleanup is intended as a short-term unblocker. A separate draft PR moves panic-abort artifacts outside the cached target tree.
How to test the change?
cargo +nightly-2026-02-08 fmt --all -- --checkcargo test -q -p libdd-data-pipeline-ffi exporter_send_telemetry_testcargo test -q -p libdd-profiling exporter::exporter_manager::tests -- --nocapturecargo test -q -p libdd-common --features reqwest test_file_dump_captures_http_request -- --nocapturecargo test -q -p libdd-data-pipeline-ffi exporter_send_telemetry_testrepeated 30 timesRUSTUP_TOOLCHAIN=nightly-2026-02-08 MIRIFLAGS="-Zmiri-disable-isolation" cargo miri test -p libdd-crashtracker enumerate_discovers_spawned_thread -- --nocapture