Skip to content

test(agent): make no-traces timeout test deterministic#9372

Merged
pabloerhard merged 1 commit into
masterfrom
BridgeAR/2026-07-15-fix-agent-no-traces-flake
Jul 15, 2026
Merged

test(agent): make no-traces timeout test deterministic#9372
pabloerhard merged 1 commit into
masterfrom
BridgeAR/2026-07-15-fix-agent-no-traces-flake

Conversation

@BridgeAR

Copy link
Copy Markdown
Member

Summary

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. Fake timers now pin the pending and settled states at 199 ms and 200 ms 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.
@dd-octo-sts

dd-octo-sts Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 6.76 MB
Deduped: 7.42 MB
No deduping: 7.42 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

@BridgeAR
BridgeAR marked this pull request as ready for review July 15, 2026 11:02
@BridgeAR
BridgeAR requested a review from a team as a code owner July 15, 2026 11:02
@BridgeAR
BridgeAR requested review from bojbrook and removed request for a team July 15, 2026 11:02
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Jul 15, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog retried 1 test - 1 passed on retry View in Datadog

🔄 Datadog auto-retried 1 job - 0 passed on retry View in Datadog

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

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

@pr-commenter

pr-commenter Bot commented Jul 15, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-15 11:12:54

Comparing candidate commit 3289f69 in PR branch BridgeAR/2026-07-15-fix-agent-no-traces-flake with baseline commit 3721357 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 2316 metrics, 42 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-24

  • unstable execution_time [-215720.066µs; +216272.333µs] or [-8.084%; +8.105%]

scenario:appsec-appsec-enabled-26

  • unstable execution_time [-233644.864µs; +235139.964µs] or [-9.130%; +9.188%]

scenario:appsec-appsec-enabled-with-attacks-24

  • unstable execution_time [-159.631ms; +164.192ms] or [-5.160%; +5.307%]

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

  • unstable execution_time [-195.741ms; +186.821ms] or [-6.719%; +6.413%]

scenario:appsec-control-20

  • unstable execution_time [-115.561ms; +137.208ms] or [-7.031%; +8.348%]

scenario:appsec-control-24

  • unstable execution_time [-110.214ms; +112.958ms] or [-8.872%; +9.093%]

scenario:appsec-control-26

  • unstable execution_time [-111.838ms; +139.608ms] or [-9.110%; +11.372%]

scenario:appsec-iast-no-vulnerability-control-20

  • unstable execution_time [-15411.561µs; +14190.694µs] or [-6.022%; +5.545%]

scenario:appsec-iast-no-vulnerability-iast-enabled-always-active-20

  • unstable execution_time [-9.015ms; +23.028ms] or [-3.531%; +9.020%]

scenario:appsec-iast-with-vulnerability-iast-enabled-default-config-20

  • unstable execution_time [-23.235ms; +32.349ms] or [-4.222%; +5.878%]

scenario:child_process-shell-string-24

  • unstable execution_time [-15.495ms; +24.604ms] or [-4.743%; +7.531%]

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

  • unstable cpu_user_time [-2232.994ms; +750.224ms] or [-23.468%; +7.885%]
  • unstable execution_time [-2286.538ms; +724.043ms] or [-22.275%; +7.053%]
  • unstable instructions [-20.2G instructions; +6.7G instructions] or [-25.346%; +8.393%]
  • unstable throughput [-145.216op/s; +455.802op/s] or [-4.500%; +14.123%]

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

  • unstable cpu_user_time [-3066.371ms; +2006.717ms] or [-33.263%; +21.768%]
  • unstable execution_time [-3116.591ms; +2046.156ms] or [-31.334%; +20.572%]
  • unstable instructions [-26.1G instructions; +17.1G instructions] or [-34.411%; +22.565%]
  • unstable max_rss_usage [-12.832MB; +8.473MB] or [-7.989%; +5.275%]
  • unstable throughput [-589.272op/s; +872.283op/s] or [-17.355%; +25.690%]

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

  • unstable cpu_user_time [-3766.452ms; +5270.575ms] or [-29.933%; +41.886%]
  • unstable execution_time [-3861.359ms; +5389.680ms] or [-28.970%; +40.436%]
  • unstable instructions [-33.1G instructions; +46.7G instructions] or [-30.928%; +43.601%]
  • unstable max_rss_usage [-11.688MB; +16.673MB] or [-6.907%; +9.853%]
  • unstable throughput [-1056.954op/s; +781.004op/s] or [-40.116%; +29.642%]

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

  • unstable cpu_user_time [-1684.646ms; +588.410ms] or [-20.424%; +7.134%]
  • unstable execution_time [-1736.365ms; +625.537ms] or [-19.389%; +6.985%]
  • unstable instructions [-14.6G instructions; +4.8G instructions] or [-21.714%; +7.093%]
  • unstable throughput [-178.076op/s; +457.668op/s] or [-4.838%; +12.435%]

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

  • unstable cpu_user_time [-3.584s; +0.478s] or [-34.796%; +4.636%]
  • unstable execution_time [-3.605s; +0.515s] or [-32.710%; +4.676%]
  • unstable instructions [-31.6G instructions; +4.2G instructions] or [-36.567%; +4.891%]
  • unstable throughput [-107.217op/s; +702.350op/s] or [-3.472%; +22.745%]

scenario:dogstatsd-with-tags-20

  • unstable cpu_user_time [-412.562ms; +275.125ms] or [-8.477%; +5.653%]
  • unstable execution_time [-408.098ms; +276.514ms] or [-8.256%; +5.594%]
  • unstable throughput [-98705.472op/s; +144451.548op/s] or [-5.811%; +8.504%]

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

  • unstable cpu_user_time [-726.667ms; +697.908ms] or [-5.657%; +5.433%]
  • unstable execution_time [-730.868ms; +703.291ms] or [-5.565%; +5.355%]
  • unstable throughput [-3.243op/s; +3.370op/s] or [-5.292%; +5.499%]

scenario:plugin-pg-service-26

  • unstable cpu_user_time [-33.030ms; +68.076ms] or [-3.696%; +7.618%]
  • unstable execution_time [-52.017ms; +60.508ms] or [-5.722%; +6.656%]

scenario:test-optimization-large-suite-20

  • unstable max_rss_usage [-5.263MB; +7.268MB] or [-6.492%; +8.965%]

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.64%. Comparing base (3721357) to head (3289f69).

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           
Flag Coverage Δ
aiguard 53.65% <ø> (-0.12%) ⬇️
aiguard-integration 57.10% <ø> (ø)
apm-bucket-0 53.88% <ø> (-0.05%) ⬇️
apm-bucket-1 58.45% <ø> (-0.05%) ⬇️
apm-bucket-2 56.18% <ø> (-0.05%) ⬇️
apm-capabilities-tracing 60.62% <ø> (ø)
apm-integrations-aerospike 53.03% <ø> (-0.05%) ⬇️
apm-integrations-confluentinc-kafka-javascript 57.12% <ø> (-0.05%) ⬇️
apm-integrations-couchbase 53.37% <ø> (-0.05%) ⬇️
apm-integrations-http 58.04% <ø> (-0.05%) ⬇️
apm-integrations-kafkajs 57.83% <ø> (-0.05%) ⬇️
apm-integrations-next 54.26% <ø> (-0.05%) ⬇️
apm-integrations-prisma 54.26% <ø> (-0.05%) ⬇️
apm-integrations-tedious 53.14% <ø> (-0.05%) ⬇️
appsec 68.92% <ø> (-0.04%) ⬇️
appsec-express_fastify_graphql 65.74% <ø> (-0.02%) ⬇️
appsec-integration 51.95% <ø> (ø)
appsec-kafka_ldapjs_lodash 59.17% <ø> (-0.04%) ⬇️
appsec-mongodb-core_mongoose_mysql 62.40% <ø> (-0.04%) ⬇️
appsec-next 52.88% <ø> (-0.04%) ⬇️
appsec-node-serialize_passport_postgres 62.04% <ø> (-0.04%) ⬇️
appsec-sourcing_stripe_template 60.43% <ø> (-0.04%) ⬇️
debugger 65.68% <ø> (-0.02%) ⬇️
instrumentations-bucket-0 48.88% <ø> (-0.05%) ⬇️
instrumentations-bucket-1 55.08% <ø> (-0.05%) ⬇️
instrumentations-bucket-10 56.71% <ø> (-0.05%) ⬇️
instrumentations-bucket-11 48.87% <ø> (-0.05%) ⬇️
instrumentations-bucket-12 49.05% <ø> (-0.05%) ⬇️
instrumentations-bucket-13 48.81% <ø> (-0.05%) ⬇️
instrumentations-bucket-2 50.02% <ø> (-0.05%) ⬇️
instrumentations-bucket-3 53.99% <ø> (-0.05%) ⬇️
instrumentations-bucket-4 49.29% <ø> (-0.05%) ⬇️
instrumentations-bucket-5 53.16% <ø> (-0.05%) ⬇️
instrumentations-bucket-6 55.73% <ø> (-0.05%) ⬇️
instrumentations-bucket-7 53.63% <ø> (-0.05%) ⬇️
instrumentations-bucket-8 54.76% <ø> (-0.05%) ⬇️
instrumentations-bucket-9 56.19% <ø> (-0.04%) ⬇️
instrumentations-instrumentation-couchbase 48.27% <ø> (-0.05%) ⬇️
instrumentations-integration-esbuild 34.07% <ø> (ø)
llmobs-ai_anthropic_bedrock 57.77% <ø> (-0.04%) ⬇️
llmobs-bucket-1 57.11% <ø> (-0.04%) ⬇️
llmobs-openai 57.50% <ø> (-0.04%) ⬇️
llmobs-sdk 60.07% <ø> (-0.05%) ⬇️
llmobs-vertex-ai 54.31% <ø> (-0.05%) ⬇️
master-coverage 96.64% <ø> (?)
openfeature 54.70% <ø> (ø)
openfeature-unit 49.91% <ø> (-0.05%) ⬇️
platform-core_esbuild_instrumentations-misc 38.54% <ø> (-0.03%) ⬇️
platform-integration 62.33% <ø> (ø)
platform-shimmer_unit-guardrails_webpack 37.33% <ø> (-0.03%) ⬇️
plugins-bucket-0 53.26% <ø> (-0.04%) ⬇️
plugins-bucket-1 55.20% <ø> (ø)
plugins-bucket-11 57.53% <ø> (-0.04%) ⬇️
plugins-bucket-18 57.14% <ø> (-0.05%) ⬇️
plugins-bucket-19 55.47% <ø> (-0.05%) ⬇️
plugins-bucket-20 57.66% <ø> (-0.05%) ⬇️
plugins-bucket-4 53.85% <ø> (-0.07%) ⬇️
plugins-bullmq_cassandra_cookie 57.47% <ø> (-0.05%) ⬇️
plugins-cookie-parser_crypto_dd-trace-api 52.42% <ø> (-0.05%) ⬇️
plugins-fetch_fs_generic-pool 54.59% <ø> (-0.05%) ⬇️
plugins-google-cloud-pubsub_grpc_handlebars 59.92% <ø> (-0.05%) ⬇️
plugins-hapi_hono_ioredis 55.86% <ø> (-0.05%) ⬇️
plugins-jest_knex_langgraph 51.77% <ø> (-0.05%) ⬇️
plugins-ldapjs_light-my-request_limitd-client 53.51% <ø> (-0.05%) ⬇️
plugins-lodash_mariadb_memcached 54.30% <ø> (-0.05%) ⬇️
plugins-moleculer_mongodb_mongodb-core 57.40% <ø> (-0.05%) ⬇️
plugins-mongoose_multer_mysql 54.79% <ø> (-0.05%) ⬇️
plugins-mysql2_nats_node-serialize 56.33% <ø> (-0.05%) ⬇️
plugins-opensearch_passport-http_pino 55.19% <ø> (-0.05%) ⬇️
plugins-postgres_process_pug 54.38% <ø> (-0.05%) ⬇️
plugins-redis_router_sequelize 57.19% <ø> (-0.05%) ⬇️
plugins-test-and-upstream-rhea_undici_url 57.06% <ø> (-0.05%) ⬇️
plugins-valkey_vm_winston 53.94% <ø> (-0.05%) ⬇️
plugins-ws 54.93% <ø> (-0.05%) ⬇️
profiling 58.26% <ø> (-0.04%) ⬇️
serverless-aws-sdk-aws-sdk 50.78% <ø> (-0.04%) ⬇️
serverless-aws-sdk-bedrockruntime 50.75% <ø> (-0.05%) ⬇️
serverless-aws-sdk-client 52.09% <ø> (-0.05%) ⬇️
serverless-aws-sdk-dynamodb 51.83% <ø> (-0.02%) ⬇️
serverless-aws-sdk-eventbridge 46.46% <ø> (-0.05%) ⬇️
serverless-aws-sdk-kinesis 54.79% <ø> (-0.05%) ⬇️
serverless-aws-sdk-lambda 52.87% <ø> (-0.05%) ⬇️
serverless-aws-sdk-s3 51.59% <ø> (-0.05%) ⬇️
serverless-aws-sdk-serverless-peer-service 54.82% <ø> (-0.05%) ⬇️
serverless-aws-sdk-sns 55.54% <ø> (-0.05%) ⬇️
serverless-aws-sdk-sqs 56.02% <ø> (+0.01%) ⬆️
serverless-aws-sdk-stepfunctions 51.36% <ø> (-0.05%) ⬇️
serverless-aws-sdk-util 48.54% <ø> (-0.05%) ⬇️
serverless-bucket-0 55.24% <ø> (ø)
serverless-bucket-1 56.06% <ø> (-0.05%) ⬇️
test-optimization-cucumber 72.95% <ø> (-0.02%) ⬇️
test-optimization-cypress 66.31% <ø> (+0.05%) ⬆️
test-optimization-jest 74.29% <ø> (-0.03%) ⬇️
test-optimization-mocha 74.69% <ø> (+0.06%) ⬆️
test-optimization-playwright-playwright-atr 61.50% <ø> (+0.02%) ⬆️
test-optimization-playwright-playwright-efd 61.69% <ø> (+0.03%) ⬆️
test-optimization-playwright-playwright-final-status 61.67% <ø> (+0.02%) ⬆️
test-optimization-playwright-playwright-impacted-tests 61.61% <ø> (+0.41%) ⬆️
test-optimization-playwright-playwright-reporting 61.28% <ø> (+0.02%) ⬆️
test-optimization-playwright-playwright-test-management 62.28% <ø> (-0.04%) ⬇️
test-optimization-playwright-playwright-test-span 61.42% <ø> (-0.02%) ⬇️
test-optimization-selenium 60.72% <ø> (-0.14%) ⬇️
test-optimization-testopt 59.16% <ø> (+0.08%) ⬆️
test-optimization-vitest 71.40% <ø> (+0.04%) ⬆️

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.

@pabloerhard
pabloerhard merged commit 1fb5af6 into master Jul 15, 2026
726 of 728 checks passed
@pabloerhard
pabloerhard deleted the BridgeAR/2026-07-15-fix-agent-no-traces-flake branch July 15, 2026 14:20
dd-octo-sts Bot pushed a commit that referenced this pull request Jul 16, 2026
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.
@dd-octo-sts dd-octo-sts Bot mentioned this pull request Jul 16, 2026
dd-octo-sts Bot pushed a commit that referenced this pull request Jul 16, 2026
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.
@dd-octo-sts dd-octo-sts Bot mentioned this pull request Jul 16, 2026
juan-fernandez pushed a commit that referenced this pull request Jul 16, 2026
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.
juan-fernandez pushed a commit that referenced this pull request Jul 16, 2026
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.
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