Skip to content

test(test-optimization): assert complete run payloads#9358

Merged
BridgeAR merged 3 commits into
masterfrom
BridgeAR/2026-07-14-complete-run-assertions
Jul 15, 2026
Merged

test(test-optimization): assert complete run payloads#9358
BridgeAR merged 3 commits into
masterfrom
BridgeAR/2026-07-14-complete-run-assertions

Conversation

@BridgeAR

Copy link
Copy Markdown
Member

Summary

Payload assertions that resolve as soon as a valid prefix arrives can miss duplicate or late events emitted before the test process finishes. This moves repeated-run, finalization, and retry contracts to the existing child-exit-plus-drain collector and pins that collector's timing behavior with fake timers.

Assertions that resolved on a valid prefix could miss duplicate or late payloads emitted before the child finished. Apply the existing post-exit drain collector to repeated-run, finalization, and retry contracts, and make its timing tests deterministic.
@dd-octo-sts

dd-octo-sts Bot commented Jul 14, 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

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Jul 14, 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 - 1 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: 571a74b | Docs | Datadog PR Page | Give us feedback!

@pr-commenter

pr-commenter Bot commented Jul 14, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-15 09:36:16

Comparing candidate commit 571a74b in PR branch BridgeAR/2026-07-14-complete-run-assertions with baseline commit 1abef82 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 2328 metrics, 30 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 [-208414.340µs; +207439.474µs] or [-7.841%; +7.804%]

scenario:appsec-appsec-enabled-26

  • unstable execution_time [-237.715ms; +170.164ms] or [-9.398%; +6.727%]

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

  • unstable execution_time [-188.010ms; +183.982ms] or [-6.476%; +6.337%]

scenario:appsec-control-20

  • unstable execution_time [-129.408ms; +118.438ms] or [-7.866%; +7.199%]

scenario:appsec-control-24

  • unstable execution_time [-111.309ms; +108.584ms] or [-8.972%; +8.753%]

scenario:appsec-control-26

  • unstable execution_time [-127.953ms; +123.648ms] or [-10.327%; +9.980%]

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

  • unstable execution_time [-12.739ms; +16.900ms] or [-5.051%; +6.701%]

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

  • unstable execution_time [-12.200ms; +18.863ms] or [-4.722%; +7.300%]

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

  • unstable execution_time [-14.913ms; +23.732ms] or [-5.653%; +8.996%]

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

  • unstable execution_time [-30.996ms; +37.574ms] or [-5.604%; +6.793%]

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

  • unstable execution_time [-25.612ms; +34.029ms] or [-4.705%; +6.251%]

scenario:child_process-file-args-24

  • unstable execution_time [-33.654ms; +15.778ms] or [-7.046%; +3.304%]

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

  • unstable cpu_user_time [-2.870s; +5.612s] or [-27.355%; +53.495%]
  • unstable execution_time [-2.838s; +5.639s] or [-25.376%; +50.414%]
  • unstable instructions [-26.1G instructions; +50.5G instructions] or [-29.695%; +57.433%]
  • unstable max_rss_usage [-10.288MB; +17.624MB] or [-6.343%; +10.866%]
  • unstable throughput [-1120.900op/s; +500.545op/s] or [-36.472%; +16.287%]

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

  • unstable cpu_user_time [-1742.165ms; +571.157ms] or [-21.087%; +6.913%]
  • unstable execution_time [-1753.058ms; +628.817ms] or [-19.567%; +7.018%]
  • unstable instructions [-14.7G instructions; +4.7G instructions] or [-21.839%; +6.955%]
  • unstable throughput [-179.242op/s; +463.135op/s] or [-4.871%; +12.586%]

scenario:dogstatsd-with-tags-20

  • unstable cpu_user_time [-259.239ms; +409.870ms] or [-5.586%; +8.831%]
  • unstable execution_time [-261.119ms; +418.625ms] or [-5.535%; +8.874%]
  • unstable throughput [-149178.043op/s; +91666.449op/s] or [-8.385%; +5.152%]

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

  • unstable cpu_user_time [-725.505ms; +702.795ms] or [-5.661%; +5.483%]
  • unstable execution_time [-724.012ms; +710.877ms] or [-5.527%; +5.427%]
  • unstable throughput [-3.276op/s; +3.335op/s] or [-5.332%; +5.428%]

scenario:plugin-mongodb-core-binary-hash-24

  • unstable execution_time [-136.130ms; +187.343ms] or [-4.699%; +6.467%]

scenario:plugin-pg-service-20

  • unstable execution_time [-70.865ms; +114.170ms] or [-4.372%; +7.043%]

scenario:test-optimization-large-suite-20

  • unstable max_rss_usage [-5254.022KB; +3312.689KB] or [-6.562%; +4.137%]

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.64%. Comparing base (1abef82) to head (571a74b).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #9358   +/-   ##
=======================================
  Coverage   96.64%   96.64%           
=======================================
  Files         923      923           
  Lines      122844   122844           
  Branches    20989    21051   +62     
=======================================
+ Hits       118723   118727    +4     
+ Misses       4121     4117    -4     
Flag Coverage Δ
aiguard 53.65% <ø> (-0.05%) ⬇️
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.19% <ø> (-0.05%) ⬇️
apm-integrations-couchbase 53.37% <ø> (-0.05%) ⬇️
apm-integrations-http 58.04% <ø> (-0.05%) ⬇️
apm-integrations-kafkajs 57.85% <ø> (-0.03%) ⬇️
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.01%) ⬆️
appsec-express_fastify_graphql 65.73% <ø> (-0.04%) ⬇️
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.04%) ⬇️
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% <ø> (-0.01%) ⬇️
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.03%) ⬇️
plugins-bucket-20 57.66% <ø> (-0.05%) ⬇️
plugins-bucket-4 53.87% <ø> (-0.05%) ⬇️
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.13%) ⬇️
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.54% <ø> (-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.02%) ⬇️
plugins-valkey_vm_winston 54.02% <ø> (-0.05%) ⬇️
plugins-ws 54.93% <ø> (-0.04%) ⬇️
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.80% <ø> (-0.05%) ⬇️
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 55.96% <ø> (-0.16%) ⬇️
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.37% <ø> (+0.08%) ⬆️
test-optimization-jest 74.29% <ø> (-0.04%) ⬇️
test-optimization-mocha 74.68% <ø> (+0.04%) ⬆️
test-optimization-playwright-playwright-atr 61.50% <ø> (ø)
test-optimization-playwright-playwright-efd 61.69% <ø> (+<0.01%) ⬆️
test-optimization-playwright-playwright-final-status 61.67% <ø> (ø)
test-optimization-playwright-playwright-impacted-tests 61.39% <ø> (+0.17%) ⬆️
test-optimization-playwright-playwright-reporting 61.28% <ø> (ø)
test-optimization-playwright-playwright-test-management 62.45% <ø> (+0.10%) ⬆️
test-optimization-playwright-playwright-test-span 61.42% <ø> (-0.05%) ⬇️
test-optimization-selenium 60.72% <ø> (-0.10%) ⬇️
test-optimization-testopt 59.16% <ø> (+0.08%) ⬆️
test-optimization-vitest 71.40% <ø> (+0.02%) ⬆️

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.

Comment thread integration-tests/ci-visibility-intake.spec.js Outdated
Comment thread integration-tests/ci-visibility-intake.spec.js Outdated
Comment thread integration-tests/ci-visibility-intake.spec.js Outdated
Comment thread integration-tests/ci-visibility-intake.spec.js Outdated
Comment thread integration-tests/ci-visibility-intake.spec.js Outdated
Co-authored-by: Ruben Bridgewater <[email protected]>
Comment thread integration-tests/ci-visibility-intake.spec.js Outdated
Comment thread integration-tests/ci-visibility-intake.spec.js Outdated
Comment thread integration-tests/ci-visibility-intake.spec.js Outdated
Comment thread integration-tests/ci-visibility-intake.spec.js Outdated
Co-authored-by: Ruben Bridgewater <[email protected]>
@BridgeAR
BridgeAR marked this pull request as ready for review July 15, 2026 09:23
@BridgeAR
BridgeAR requested a review from a team as a code owner July 15, 2026 09:23

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Datadog Autotest: PASS

More details

PR migrates payload assertions from early-resolution (gatherPayloadsMaxTimeout) to late-resolution (gatherPayloadsUntilChildExit) to catch duplicate/late events emitted before child process exit. All 9 unit tests pass, including the critical duplicate-detection test that validates the fix; real integration test files have correct syntax and API usage. No behavioral regressions found.

Was this helpful? React 👍 or 👎

📊 Validated against 9 scenarios · Open Bits AI session

🤖 Datadog Autotest · Commit 571a74b · What is Autotest? · Any feedback? Reach out in #autotest

@BridgeAR
BridgeAR merged commit 3721357 into master Jul 15, 2026
691 of 692 checks passed
@BridgeAR
BridgeAR deleted the BridgeAR/2026-07-14-complete-run-assertions branch July 15, 2026 10:06
dd-octo-sts Bot pushed a commit that referenced this pull request Jul 16, 2026
Assertions that resolved on a valid prefix could miss duplicate or late payloads emitted before the child finished. Apply the existing post-exit drain collector to repeated-run, finalization, and retry contracts, and make its timing tests deterministic.
@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
Assertions that resolved on a valid prefix could miss duplicate or late payloads emitted before the child finished. Apply the existing post-exit drain collector to repeated-run, finalization, and retry contracts, and make its timing tests deterministic.
@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
Assertions that resolved on a valid prefix could miss duplicate or late payloads emitted before the child finished. Apply the existing post-exit drain collector to repeated-run, finalization, and retry contracts, and make its timing tests deterministic.
juan-fernandez pushed a commit that referenced this pull request Jul 16, 2026
Assertions that resolved on a valid prefix could miss duplicate or late payloads emitted before the child finished. Apply the existing post-exit drain collector to repeated-run, finalization, and retry contracts, and make its timing tests deterministic.
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