Skip to content

test(runtime-metrics): widen GC pause p95 bound to deflake#9121

Merged
pabloerhard merged 1 commit into
masterfrom
BridgeAR/2026-06-28-fix-flaky-gc-pause-p95
Jun 30, 2026
Merged

test(runtime-metrics): widen GC pause p95 bound to deflake#9121
pabloerhard merged 1 commit into
masterfrom
BridgeAR/2026-06-28-fix-flaky-gc-pause-p95

Conversation

@BridgeAR

Copy link
Copy Markdown
Member

Summary

The non-native runtime metrics test (should start collecting runtimeMetrics every 10 seconds) 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 (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 aggregate runtime.node.gc.pause.95percentile already used the loose isFiniteNumber matcher — 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

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.
@dd-octo-sts

dd-octo-sts Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 6.39 MB
Deduped: 7.46 MB
No deduping: 7.46 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

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Jun 28, 2026

Copy link
Copy Markdown

Tests

Fix all issues with BitsAI

⚠️ Warnings

1 Test performance regression detected

exports logs with complete OTLP structure, trace correlation, and instrumentation info from Mocha Tests — 2.71s (+2.2s, +431%)   View in Datadog

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 87.98% (+0.00%)

Useful? React with 👍 / 👎

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

@pr-commenter

pr-commenter Bot commented Jun 28, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-06-28 00:50:23

Comparing candidate commit d9bafd0 in PR branch BridgeAR/2026-06-28-fix-flaky-gc-pause-p95 with baseline commit 27dcc31 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 2249 metrics, 37 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:appsec-appsec-enabled-20

  • unstable execution_time [-187553.470µs; +186667.704µs] or [-5.033%; +5.009%]

scenario:appsec-appsec-enabled-24

  • unstable execution_time [-181.953ms; +178.414ms] or [-6.940%; +6.805%]

scenario:appsec-appsec-enabled-26

  • unstable execution_time [-205.163ms; +198.220ms] or [-8.142%; +7.866%]

scenario:appsec-appsec-enabled-with-attacks-26

  • unstable execution_time [-155.212ms; +148.481ms] or [-5.388%; +5.154%]

scenario:appsec-control-20

  • unstable execution_time [-174.286ms; +155.418ms] or [-9.899%; +8.828%]

scenario:appsec-control-24

  • unstable execution_time [-103710.019µs; +103357.385µs] or [-8.540%; +8.511%]

scenario:appsec-control-26

  • unstable execution_time [-111.978ms; +107.508ms] or [-9.266%; +8.896%]

scenario:debugger-line-probe-with-snapshot-default-24

  • unstable cpu_user_time [-1631.869ms; +529.880ms] or [-20.670%; +6.712%]
  • unstable execution_time [-1633.795ms; +552.357ms] or [-19.004%; +6.425%]
  • unstable instructions [-13.9G instructions; +4.5G instructions] or [-21.559%; +6.995%]
  • unstable throughput [-168.863op/s; +483.847op/s] or [-4.400%; +12.609%]

scenario:debugger-line-probe-with-snapshot-default-26

  • unstable cpu_user_time [-2077.977ms; +3272.163ms] or [-22.086%; +34.779%]
  • unstable execution_time [-2066.884ms; +3286.284ms] or [-20.437%; +32.495%]
  • unstable instructions [-18.6G instructions; +29.4G instructions] or [-23.760%; +37.553%]
  • unstable max_rss_usage [-6.857MB; +10.293MB] or [-4.323%; +6.490%]
  • unstable throughput [-713.909op/s; +449.858op/s] or [-22.009%; +13.868%]

scenario:debugger-line-probe-with-snapshot-minimal-24

  • unstable cpu_user_time [-1738.882ms; +556.140ms] or [-21.897%; +7.003%]
  • unstable execution_time [-1750.421ms; +569.326ms] or [-20.318%; +6.608%]
  • unstable instructions [-14.6G instructions; +4.7G instructions] or [-22.589%; +7.336%]
  • unstable throughput [-165.105op/s; +506.604op/s] or [-4.301%; +13.197%]

scenario:debugger-line-probe-without-snapshot-24

  • unstable cpu_user_time [-2734.576ms; +2674.727ms] or [-32.099%; +31.397%]
  • unstable execution_time [-2773.082ms; +2744.718ms] or [-30.107%; +29.799%]
  • unstable instructions [-23313.2M instructions; +23377.2M instructions] or [-33.526%; +33.618%]
  • unstable max_rss_usage [-9843.107KB; +9807.907KB] or [-6.138%; +6.116%]
  • unstable throughput [-791.045op/s; +805.088op/s] or [-21.593%; +21.976%]

scenario:debugger-line-probe-without-snapshot-26

  • unstable cpu_user_time [-2346.142ms; +4305.103ms] or [-23.064%; +42.322%]
  • unstable execution_time [-2383.293ms; +4343.713ms] or [-21.926%; +39.961%]
  • unstable instructions [-20.9G instructions; +38.8G instructions] or [-24.462%; +45.298%]
  • unstable max_rss_usage [-7.564MB; +13.879MB] or [-4.693%; +8.611%]
  • unstable throughput [-940.569op/s; +545.200op/s] or [-30.603%; +17.739%]

scenario:dogstatsd-with-tags-20

  • unstable cpu_user_time [-463.325ms; +228.604ms] or [-9.567%; +4.720%]
  • unstable execution_time [-466.754ms; +227.993ms] or [-9.497%; +4.639%]
  • unstable throughput [-77638.948op/s; +160693.330op/s] or [-4.543%; +9.403%]

scenario:plugin-aws-sdk-lambda-inject-with-context-24

  • unstable cpu_user_time [-160.665ms; +226.828ms] or [-4.199%; +5.928%]
  • unstable execution_time [-160.914ms; +227.269ms] or [-4.180%; +5.903%]

scenario:plugin-graphql-long-with-depth-and-collapse-off-20

  • unstable max_rss_usage [-30.715MB; +23.965MB] or [-7.992%; +6.236%]

scenario:plugin-graphql-long-with-depth-on-max-20

  • unstable max_rss_usage [-54.217MB; +73.416MB] or [-26.487%; +35.867%]

@codecov

codecov Bot commented Jun 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.69%. Comparing base (27dcc31) to head (d9bafd0).
⚠️ Report is 11 commits behind head on master.

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           
Flag Coverage Δ
aiguard 34.88% <ø> (-0.08%) ⬇️
aiguard-integration 41.79% <ø> (ø)
apm-bucket-0 34.85% <ø> (-0.08%) ⬇️
apm-bucket-1 40.34% <ø> (-0.07%) ⬇️
apm-bucket-2 37.35% <ø> (-0.07%) ⬇️
apm-capabilities-tracing 48.29% <ø> (ø)
apm-integrations-aerospike 33.13% <ø> (-0.08%) ⬇️
apm-integrations-confluentinc-kafka-javascript 40.04% <ø> (-0.08%) ⬇️
apm-integrations-couchbase 33.41% <ø> (-0.19%) ⬇️
apm-integrations-http 42.04% <ø> (-0.07%) ⬇️
apm-integrations-kafkajs 40.26% <ø> (-0.08%) ⬇️
apm-integrations-next 29.51% <ø> (-0.07%) ⬇️
apm-integrations-prisma 35.04% <ø> (-0.07%) ⬇️
apm-integrations-tedious 33.90% <ø> (-0.08%) ⬇️
appsec 57.40% <ø> (-0.05%) ⬇️
appsec-express_fastify_graphql 53.78% <ø> (-0.02%) ⬇️
appsec-integration 36.25% <ø> (ø)
appsec-kafka_ldapjs_lodash 43.60% <ø> (-0.07%) ⬇️
appsec-mongodb-core_mongoose_mysql 48.81% <ø> (-0.06%) ⬇️
appsec-next 28.01% <ø> (-0.07%) ⬇️
appsec-node-serialize_passport_postgres 48.01% <ø> (-0.06%) ⬇️
appsec-sourcing_stripe_template 45.56% <ø> (-0.06%) ⬇️
debugger 44.37% <ø> (-0.05%) ⬇️
instrumentations-bucket-0 28.16% <ø> (-0.08%) ⬇️
instrumentations-bucket-1 37.41% <ø> (-0.07%) ⬇️
instrumentations-bucket-10 40.44% <ø> (-0.07%) ⬇️
instrumentations-bucket-11 27.96% <ø> (-0.08%) ⬇️
instrumentations-bucket-12 28.67% <ø> (-0.08%) ⬇️
instrumentations-bucket-13 27.79% <ø> (-0.08%) ⬇️
instrumentations-bucket-2 30.24% <ø> (-0.07%) ⬇️
instrumentations-bucket-3 35.91% <ø> (-0.07%) ⬇️
instrumentations-bucket-4 28.07% <ø> (-0.08%) ⬇️
instrumentations-bucket-5 36.28% <ø> (-0.07%) ⬇️
instrumentations-bucket-6 38.26% <ø> (-0.08%) ⬇️
instrumentations-bucket-7 36.01% <ø> (-0.07%) ⬇️
instrumentations-bucket-8 36.96% <ø> (-0.07%) ⬇️
instrumentations-bucket-9 39.53% <ø> (-0.07%) ⬇️
instrumentations-instrumentation-couchbase 46.54% <ø> (ø)
instrumentations-integration-esbuild 24.87% <ø> (ø)
llmobs-ai_anthropic_bedrock 39.54% <ø> (-0.07%) ⬇️
llmobs-google-genai_langchain_vertex-ai 36.98% <ø> (-0.06%) ⬇️
llmobs-openai 39.59% <ø> (-0.07%) ⬇️
llmobs-sdk 43.60% <ø> (-0.08%) ⬇️
master-coverage 93.69% <ø> (?)
openfeature 37.76% <ø> (ø)
openfeature-unit 50.39% <ø> (ø)
platform-core_esbuild_instrumentations-misc 23.36% <ø> (ø)
platform-integration 47.44% <ø> (+0.01%) ⬆️
platform-shimmer_unit-guardrails_webpack 18.89% <ø> (ø)
plugins-bucket-0 36.34% <ø> (-0.07%) ⬇️
plugins-bucket-1 39.61% <ø> (ø)
plugins-bucket-11 38.47% <ø> (-0.08%) ⬇️
plugins-bucket-17 39.16% <ø> (-0.07%) ⬇️
plugins-bucket-18 42.01% <ø> (-0.07%) ⬇️
plugins-bucket-19 39.57% <ø> (-0.07%) ⬇️
plugins-bucket-20 43.26% <ø> (-0.10%) ⬇️
plugins-bucket-4 37.72% <ø> (-0.07%) ⬇️
plugins-bullmq_cassandra_cookie 39.77% <ø> (-0.07%) ⬇️
plugins-cookie-parser_crypto_dd-trace-api 33.23% <ø> (-0.08%) ⬇️
plugins-fetch_fs_generic-pool 36.06% <ø> (-0.07%) ⬇️
plugins-google-cloud-pubsub_grpc_handlebars 43.11% <ø> (-0.08%) ⬇️
plugins-hapi_hono_ioredis 37.79% <ø> (-0.07%) ⬇️
plugins-jest_knex_langgraph 32.61% <ø> (-0.08%) ⬇️
plugins-ldapjs_light-my-request_limitd-client 27.85% <ø> (-0.08%) ⬇️
plugins-lodash_mariadb_memcached 35.18% <ø> (-0.08%) ⬇️
plugins-mongodb_mongodb-core_mongoose 36.32% <ø> (-0.07%) ⬇️
plugins-multer_mysql_mysql2 35.15% <ø> (-0.08%) ⬇️
plugins-nats_node-serialize_opensearch 37.16% <ø> (-0.08%) ⬇️
plugins-passport-http_pino_postgres 35.54% <ø> (-0.08%) ⬇️
plugins-process_pug_redis 34.27% <ø> (-0.08%) ⬇️
plugins-undici_url_valkey 35.88% <ø> (-0.07%) ⬇️
plugins-vm_winston_ws 37.56% <ø> (-0.08%) ⬇️
profiling 43.62% <ø> (-0.07%) ⬇️
serverless-aws-sdk-aws-sdk 33.30% <ø> (-0.07%) ⬇️
serverless-aws-sdk-bedrockruntime 32.17% <ø> (-0.07%) ⬇️
serverless-aws-sdk-client 37.21% <ø> (ø)
serverless-aws-sdk-dynamodb 34.15% <ø> (-0.07%) ⬇️
serverless-aws-sdk-eventbridge 27.25% <ø> (-0.07%) ⬇️
serverless-aws-sdk-kinesis 37.41% <ø> (-0.07%) ⬇️
serverless-aws-sdk-lambda 34.60% <ø> (-0.07%) ⬇️
serverless-aws-sdk-s3 32.60% <ø> (-0.07%) ⬇️
serverless-aws-sdk-serverless-peer-service 39.47% <ø> (-0.08%) ⬇️
serverless-aws-sdk-sns 38.26% <ø> (-0.19%) ⬇️
serverless-aws-sdk-sqs 38.01% <ø> (-0.07%) ⬇️
serverless-aws-sdk-stepfunctions 33.19% <ø> (-0.07%) ⬇️
serverless-aws-sdk-util 47.95% <ø> (ø)
serverless-bucket-0 39.47% <ø> (ø)
serverless-lambda 34.33% <ø> (-0.09%) ⬇️
test-optimization-cucumber 52.57% <ø> (+0.11%) ⬆️
test-optimization-cypress 49.62% <ø> (+0.07%) ⬆️
test-optimization-jest 55.64% <ø> (+0.07%) ⬆️
test-optimization-mocha 53.69% <ø> (+0.11%) ⬆️
test-optimization-playwright-playwright-atr 43.59% <ø> (+0.08%) ⬆️
test-optimization-playwright-playwright-efd 43.87% <ø> (+0.08%) ⬆️
test-optimization-playwright-playwright-final-status 43.93% <ø> (+0.08%) ⬆️
test-optimization-playwright-playwright-impacted-tests 43.41% <ø> (ø)
test-optimization-playwright-playwright-reporting 43.50% <ø> (+0.08%) ⬆️
test-optimization-playwright-playwright-test-management 44.93% <ø> (+0.08%) ⬆️
test-optimization-playwright-playwright-test-span 44.78% <ø> (+0.07%) ⬆️
test-optimization-selenium 45.52% <ø> (+0.06%) ⬆️
test-optimization-testopt 48.28% <ø> (+0.08%) ⬆️
test-optimization-vitest 50.93% <ø> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@BridgeAR
BridgeAR marked this pull request as ready for review June 30, 2026 07:07
@BridgeAR
BridgeAR requested a review from a team as a code owner June 30, 2026 07:07
@BridgeAR
BridgeAR requested review from khanayan123 and removed request for a team June 30, 2026 07:07
@pabloerhard
pabloerhard merged commit 2d62430 into master Jun 30, 2026
1377 of 1382 checks passed
@pabloerhard
pabloerhard deleted the BridgeAR/2026-06-28-fix-flaky-gc-pause-p95 branch June 30, 2026 16:40
dd-octo-sts Bot pushed a commit that referenced this pull request Jul 1, 2026
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.
This was referenced Jul 1, 2026
rochdev pushed a commit that referenced this pull request Jul 2, 2026
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.
rochdev pushed a commit that referenced this pull request Jul 2, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants