test(agent): make no-traces timeout test deterministic#9372
Conversation
Node does not guarantee that Date.now() reports the full delay when a setTimeout callback runs, so the exact 200 ms lower bound occasionally observed 199 ms. Advancing fake timers across the 199/200 ms boundary pins the contract without depending on scheduler timing.
Overall package sizeSelf size: 6.76 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.1 | 122.62 kB | 438.86 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
🎉 All green!🧪 All tests passed 🔄 Datadog retried 1 test - 1 passed on retry 🔄 Datadog auto-retried 1 job - 0 passed on retry 🎯 Code Coverage (details) 🔗 Commit SHA: 3289f69 | Docs | Datadog PR Page | Give us feedback! |
BenchmarksBenchmark execution time: 2026-07-15 11:12:54 Comparing candidate commit 3289f69 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 2316 metrics, 42 unstable metrics.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9372 +/- ##
=======================================
Coverage 96.64% 96.64%
=======================================
Files 923 923
Lines 122844 122844
Branches 21042 21079 +37
=======================================
Hits 118725 118725
Misses 4119 4119 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Node does not guarantee that Date.now() reports the full delay when a setTimeout callback runs, so the exact 200 ms lower bound occasionally observed 199 ms. Advancing fake timers across the 199/200 ms boundary pins the contract without depending on scheduler timing.
Node does not guarantee that Date.now() reports the full delay when a setTimeout callback runs, so the exact 200 ms lower bound occasionally observed 199 ms. Advancing fake timers across the 199/200 ms boundary pins the contract without depending on scheduler timing.
Node does not guarantee that Date.now() reports the full delay when a setTimeout callback runs, so the exact 200 ms lower bound occasionally observed 199 ms. Advancing fake timers across the 199/200 ms boundary pins the contract without depending on scheduler timing.
Node does not guarantee that Date.now() reports the full delay when a setTimeout callback runs, so the exact 200 ms lower bound occasionally observed 199 ms. Advancing fake timers across the 199/200 ms boundary pins the contract without depending on scheduler timing.
Summary
Node does not guarantee that
Date.now()reports the full delay when asetTimeout()callback runs, so the exact 200 ms lower bound occasionally observed 199 ms. Fake timers now pin the pending and settled states at 199 ms and 200 ms without depending on scheduler timing.