test(runtime-metrics): widen GC pause p95 bound to deflake#9121
Conversation
The non-native runtime metrics test asserted that runtime.node.gc.pause.by.type.95percentile lands in [0.1ms, 100ms). On a fast or idle runner a gc_type can have a single scavenge sample whose p95 sits below 0.1ms, so the matcher rejected a legitimate value and the test failed on Windows. The bounds exist to catch a unit-conversion regression, not to assert a minimum pause length: a sub-microsecond value would mean the ms->ns conversion was dropped, a value over 100ms that it was left in ms or seconds. Lower the floor to 1µs so it still trips on a dropped conversion while no longer assuming a GC pause takes at least 0.1ms.
Overall package sizeSelf size: 6.39 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.2.0 | 104.26 kB | 843.44 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 |
|
BenchmarksBenchmark execution time: 2026-06-28 00:50:23 Comparing candidate commit d9bafd0 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 2249 metrics, 37 unstable metrics.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9121 +/- ##
=======================================
Coverage 93.69% 93.69%
=======================================
Files 889 889
Lines 50856 50856
Branches 11830 11830
=======================================
Hits 47647 47647
Misses 3209 3209 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:
|
The non-native runtime metrics test asserted that runtime.node.gc.pause.by.type.95percentile lands in [0.1ms, 100ms). On a fast or idle runner a gc_type can have a single scavenge sample whose p95 sits below 0.1ms, so the matcher rejected a legitimate value and the test failed on Windows. The bounds exist to catch a unit-conversion regression, not to assert a minimum pause length: a sub-microsecond value would mean the ms->ns conversion was dropped, a value over 100ms that it was left in ms or seconds. Lower the floor to 1µs so it still trips on a dropped conversion while no longer assuming a GC pause takes at least 0.1ms.
The non-native runtime metrics test asserted that runtime.node.gc.pause.by.type.95percentile lands in [0.1ms, 100ms). On a fast or idle runner a gc_type can have a single scavenge sample whose p95 sits below 0.1ms, so the matcher rejected a legitimate value and the test failed on Windows. The bounds exist to catch a unit-conversion regression, not to assert a minimum pause length: a sub-microsecond value would mean the ms->ns conversion was dropped, a value over 100ms that it was left in ms or seconds. Lower the floor to 1µs so it still trips on a dropped conversion while no longer assuming a GC pause takes at least 0.1ms.
The non-native runtime metrics test asserted that runtime.node.gc.pause.by.type.95percentile lands in [0.1ms, 100ms). On a fast or idle runner a gc_type can have a single scavenge sample whose p95 sits below 0.1ms, so the matcher rejected a legitimate value and the test failed on Windows. The bounds exist to catch a unit-conversion regression, not to assert a minimum pause length: a sub-microsecond value would mean the ms->ns conversion was dropped, a value over 100ms that it was left in ms or seconds. Lower the floor to 1µs so it still trips on a dropped conversion while no longer assuming a GC pause takes at least 0.1ms.
Summary
The non-native runtime metrics test (
should start collecting runtimeMetrics every 10 seconds) asserted thatruntime.node.gc.pause.by.type.95percentilelands in[0.1ms, 100ms). On a fast or idle runner agc_typecan have a single scavenge sample whose p95 sits below 0.1ms, so the matcher rejected a legitimate value and the test failed on Windows.The bounds exist to catch a unit-conversion regression, not to assert a minimum pause length: a sub-microsecond value would mean the ms→ns conversion (
entry.duration * 1e6) was dropped, a value over 100ms that it was left in ms or seconds. The floor drops to 1µs so it still trips on a dropped conversion while no longer assuming a GC pause takes at least 0.1ms. The aggregateruntime.node.gc.pause.95percentilealready used the looseisFiniteNumbermatcher — this brings the per-type bound in line.Surfaced on an unrelated PR's Windows run: https://github.com/DataDog/dd-trace-js/actions/runs/28304714675/job/83858836956
Test plan
node --expose-gc ./node_modules/mocha/bin/mocha.js --timeout 30000 packages/dd-trace/test/runtime_metrics.spec.js