Skip to content

test(test-optimization): stabilize Playwright retry tagging flake#9216

Merged
juan-fernandez merged 1 commit into
masterfrom
juan-fernandez/fix-testopt-browser-flakes
Jul 6, 2026
Merged

test(test-optimization): stabilize Playwright retry tagging flake#9216
juan-fernandez merged 1 commit into
masterfrom
juan-fernandez/fix-testopt-browser-flakes

Conversation

@juan-fernandez

@juan-fernandez juan-fernandez commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Stabilizes the Playwright retry-tagging integration test by waiting for the Playwright child process to exit before asserting the final intake payload buffer.

Motivation

The linked GitHub Actions job failed on its first attempt and passed on retry. The failing attempt asserted after seeing only 2 of the expected 4 retry test events, so the test could fail before all retry payloads had drained into the fake intake.

Flaky job evidence:

Additional Notes

Validated with:

./node_modules/.bin/eslint integration-tests/playwright/playwright-active-test-span.spec.js --max-warnings 0
PLAYWRIGHT_VERSION=latest SPEC=playwright-active-test-span npm run test:integration:playwright:coverage -- --grep "does not send attempt to fix tags"
git diff --check

@dd-octo-sts

dd-octo-sts Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 6.53 MB
Deduped: 7.19 MB
No deduping: 7.19 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.0 | 117.14 kB | 432.47 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 6, 2026

Copy link
Copy Markdown

Tests

Fix all issues with BitsAI

⚠️ Warnings

🧪 1 Test failed in 1 job

Test Optimization | integration-playwright   GitHub Actions

All test failures are known flaky — job may pass on retry.

❄️ Known flaky: playwright@latest final status tag sets final_status tag only on last ATR retry when EFD is enabled but not active and ATR is active from integration-tests/playwright/playwright-final-status.spec.js   View in Datadog
Expected 1 > 1

Not introduced in this PR.

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

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

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 87.86% (-0.00%)

Useful? React with 👍 / 👎

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

@juan-fernandez
juan-fernandez force-pushed the juan-fernandez/fix-testopt-browser-flakes branch from 2998691 to 1227b0e Compare July 6, 2026 08:59
@juan-fernandez
juan-fernandez force-pushed the juan-fernandez/fix-testopt-browser-flakes branch from 1227b0e to 9d7f67e Compare July 6, 2026 09:06
@juan-fernandez juan-fernandez changed the title test(test-optimization): stabilize browser integration flakes test(test-optimization): stabilize Playwright retry tagging flake Jul 6, 2026
@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.65%. Comparing base (8750f7f) to head (9d7f67e).
⚠️ Report is 15 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9216      +/-   ##
==========================================
+ Coverage   93.64%   93.65%   +0.01%     
==========================================
  Files         898      899       +1     
  Lines       52361    52473     +112     
  Branches    12321    12352      +31     
==========================================
+ Hits        49033    49144     +111     
- Misses       3328     3329       +1     
Flag Coverage Δ
aiguard 34.98% <ø> (+0.02%) ⬆️
aiguard-integration 41.98% <ø> (+0.01%) ⬆️
apm-bucket-0 34.84% <ø> (-0.09%) ⬇️
apm-bucket-1 40.51% <ø> (-0.09%) ⬇️
apm-bucket-2 37.50% <ø> (-0.09%) ⬇️
apm-capabilities-tracing 48.93% <ø> (+0.04%) ⬆️
apm-integrations-aerospike 33.13% <ø> (-0.09%) ⬇️
apm-integrations-confluentinc-kafka-javascript 40.12% <ø> (+0.01%) ⬆️
apm-integrations-couchbase 33.41% <ø> (-0.09%) ⬇️
apm-integrations-http 42.05% <ø> (-0.08%) ⬇️
apm-integrations-kafkajs 40.26% <ø> (-0.08%) ⬇️
apm-integrations-next 29.59% <ø> (-0.12%) ⬇️
apm-integrations-prisma 35.18% <ø> (-0.09%) ⬇️
apm-integrations-tedious 34.04% <ø> (-0.09%) ⬇️
appsec 57.81% <ø> (-0.16%) ⬇️
appsec-express_fastify_graphql 53.84% <ø> (-0.06%) ⬇️
appsec-integration 35.62% <ø> (-0.07%) ⬇️
appsec-kafka_ldapjs_lodash 43.75% <ø> (-0.07%) ⬇️
appsec-mongodb-core_mongoose_mysql 48.91% <ø> (-0.07%) ⬇️
appsec-next 28.04% <ø> (-0.15%) ⬇️
appsec-node-serialize_passport_postgres 48.13% <ø> (-0.02%) ⬇️
appsec-sourcing_stripe_template 45.64% <ø> (-0.07%) ⬇️
debugger 44.63% <ø> (-0.01%) ⬇️
instrumentations-bucket-0 28.16% <ø> (-0.09%) ⬇️
instrumentations-bucket-1 37.57% <ø> (-0.09%) ⬇️
instrumentations-bucket-10 40.51% <ø> (-0.08%) ⬇️
instrumentations-bucket-11 27.96% <ø> (-0.09%) ⬇️
instrumentations-bucket-12 28.79% <ø> (-0.09%) ⬇️
instrumentations-bucket-13 27.79% <ø> (-0.09%) ⬇️
instrumentations-bucket-2 30.36% <ø> (-0.08%) ⬇️
instrumentations-bucket-3 36.06% <ø> (-0.09%) ⬇️
instrumentations-bucket-4 28.57% <ø> (-0.09%) ⬇️
instrumentations-bucket-5 36.42% <ø> (-0.08%) ⬇️
instrumentations-bucket-6 38.42% <ø> (-0.09%) ⬇️
instrumentations-bucket-7 36.16% <ø> (-0.08%) ⬇️
instrumentations-bucket-8 37.11% <ø> (-0.08%) ⬇️
instrumentations-bucket-9 39.61% <ø> (-0.08%) ⬇️
instrumentations-instrumentation-couchbase 46.48% <ø> (ø)
instrumentations-integration-esbuild 24.47% <ø> (-0.05%) ⬇️
llmobs-ai_anthropic_bedrock 39.68% <ø> (-0.08%) ⬇️
llmobs-google-genai_langchain_vertex-ai 36.98% <ø> (-0.19%) ⬇️
llmobs-openai 39.74% <ø> (-0.08%) ⬇️
llmobs-sdk 43.59% <ø> (-0.09%) ⬇️
master-coverage 93.65% <ø> (?)
openfeature 37.94% <ø> (-0.01%) ⬇️
openfeature-unit 50.47% <ø> (ø)
platform-core_esbuild_instrumentations-misc 22.92% <ø> (-0.05%) ⬇️
platform-integration 47.58% <ø> (-0.01%) ⬇️
platform-shimmer_unit-guardrails_webpack 18.44% <ø> (-0.04%) ⬇️
plugins-bucket-0 36.52% <ø> (-0.08%) ⬇️
plugins-bucket-1 39.78% <ø> (-0.01%) ⬇️
plugins-bucket-11 38.63% <ø> (-0.09%) ⬇️
plugins-bucket-17 39.22% <ø> (-0.19%) ⬇️
plugins-bucket-18 42.17% <ø> (-0.09%) ⬇️
plugins-bucket-19 39.97% <ø> (+0.15%) ⬆️
plugins-bucket-20 43.43% <ø> (-0.04%) ⬇️
plugins-bucket-4 37.88% <ø> (-0.09%) ⬇️
plugins-bullmq_cassandra_cookie 39.93% <ø> (-0.09%) ⬇️
plugins-cookie-parser_crypto_dd-trace-api 33.22% <ø> (-0.09%) ⬇️
plugins-fetch_fs_generic-pool 36.20% <ø> (-0.09%) ⬇️
plugins-google-cloud-pubsub_grpc_handlebars 43.08% <ø> (-0.09%) ⬇️
plugins-hapi_hono_ioredis 37.94% <ø> (-0.09%) ⬇️
plugins-jest_knex_langgraph 32.61% <ø> (-0.09%) ⬇️
plugins-ldapjs_light-my-request_limitd-client 27.86% <ø> (-0.09%) ⬇️
plugins-lodash_mariadb_memcached 35.17% <ø> (-0.09%) ⬇️
plugins-mongodb_mongodb-core_mongoose 36.46% <ø> (-0.09%) ⬇️
plugins-multer_mysql_mysql2 35.15% <ø> (-0.09%) ⬇️
plugins-nats_node-serialize_opensearch 37.31% <ø> (-0.09%) ⬇️
plugins-passport-http_pino_postgres 35.53% <ø> (-0.09%) ⬇️
plugins-process_pug_redis 34.26% <ø> (-0.09%) ⬇️
plugins-undici_url_valkey 36.03% <ø> (-0.09%) ⬇️
plugins-vm_winston_ws 37.72% <ø> (-0.09%) ⬇️
profiling 43.81% <ø> (-0.07%) ⬇️
serverless-aws-sdk-aws-sdk 33.32% <ø> (-0.17%) ⬇️
serverless-aws-sdk-bedrockruntime 32.19% <ø> (-0.17%) ⬇️
serverless-aws-sdk-client 37.16% <ø> (ø)
serverless-aws-sdk-dynamodb 34.19% <ø> (-0.17%) ⬇️
serverless-aws-sdk-eventbridge 27.36% <ø> (-0.07%) ⬇️
serverless-aws-sdk-kinesis 37.55% <ø> (-0.09%) ⬇️
serverless-aws-sdk-lambda 34.64% <ø> (-0.17%) ⬇️
serverless-aws-sdk-s3 32.63% <ø> (-0.17%) ⬇️
serverless-aws-sdk-serverless-peer-service 39.65% <ø> (-0.10%) ⬇️
serverless-aws-sdk-sns 38.40% <ø> (-0.09%) ⬇️
serverless-aws-sdk-sqs 38.14% <ø> (-0.09%) ⬇️
serverless-aws-sdk-stepfunctions 33.22% <ø> (-0.17%) ⬇️
serverless-aws-sdk-util 47.95% <ø> (ø)
serverless-bucket-0 39.63% <ø> (-0.01%) ⬇️
serverless-lambda 34.34% <ø> (-0.11%) ⬇️
test-optimization-cucumber 52.55% <ø> (+0.11%) ⬆️
test-optimization-cypress 49.63% <ø> (+0.06%) ⬆️
test-optimization-jest 55.70% <ø> (+0.26%) ⬆️
test-optimization-mocha 53.62% <ø> (+0.08%) ⬆️
test-optimization-playwright-playwright-atr 43.53% <ø> (+0.08%) ⬆️
test-optimization-playwright-playwright-efd 43.82% <ø> (+0.09%) ⬆️
test-optimization-playwright-playwright-final-status 44.17% <ø> (+0.32%) ⬆️
test-optimization-playwright-playwright-impacted-tests 43.36% <ø> (+<0.01%) ⬆️
test-optimization-playwright-playwright-reporting 43.47% <ø> (+0.08%) ⬆️
test-optimization-playwright-playwright-test-management 44.94% <ø> (-0.14%) ⬇️
test-optimization-playwright-playwright-test-span 44.72% <ø> (+0.08%) ⬆️
test-optimization-selenium 45.49% <ø> (+0.11%) ⬆️
test-optimization-testopt 46.81% <ø> (+0.07%) ⬆️
test-optimization-vitest 52.80% <ø> (+0.17%) ⬆️

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.

@juan-fernandez
juan-fernandez marked this pull request as ready for review July 6, 2026 11:45
@juan-fernandez
juan-fernandez requested a review from a team as a code owner July 6, 2026 11:45

@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

The root-cause flake is confirmed synthetic: gatherPayloadsMaxTimeout has an early-exit path that calls the assertion callback on each arriving payload and resolves immediately if it passes — or, if still failing at the 15-second mark, rejects with a partial buffer. Under CI timing pressure, only 2 of the expected 4 retry events had arrived when the timeout fired. gatherPayloadsUntilChildExit eliminates the race entirely by deferring the single assertion until child exit + 1-second grace period, collecting the full buffer first.

Was this helpful? React 👍 or 👎

📊 Validated against 6 scenarios · Open Bits AI session

🤖 Datadog Autotest · Commit 9d7f67e · What is Autotest? · Any feedback? Reach out in #autotest

@pr-commenter

pr-commenter Bot commented Jul 6, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-06 12:15:21

Comparing candidate commit 9d7f67e in PR branch juan-fernandez/fix-testopt-browser-flakes with baseline commit 8750f7f in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 2247 metrics, 39 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 [-187.057ms; +196.402ms] or [-5.041%; +5.293%]

scenario:appsec-appsec-enabled-24

  • unstable execution_time [-181.205ms; +177.554ms] or [-6.867%; +6.729%]

scenario:appsec-appsec-enabled-26

  • unstable execution_time [-205.301ms; +200.898ms] or [-8.210%; +8.034%]

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

  • unstable execution_time [-154.723ms; +157.151ms] or [-5.393%; +5.478%]

scenario:appsec-control-20

  • unstable execution_time [-161.095ms; +158.823ms] or [-9.219%; +9.089%]

scenario:appsec-control-24

  • unstable execution_time [-107240.643µs; +107673.676µs] or [-8.822%; +8.857%]

scenario:appsec-control-26

  • unstable execution_time [-113.789ms; +109.816ms] or [-9.448%; +9.118%]

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

  • unstable cpu_user_time [-1841.029ms; +2320.689ms] or [-21.272%; +26.814%]
  • unstable execution_time [-1839.247ms; +2338.348ms] or [-19.699%; +25.044%]
  • unstable instructions [-15.5G instructions; +19.8G instructions] or [-21.860%; +28.042%]
  • unstable max_rss_usage [-6.639MB; +10.912MB] or [-4.226%; +6.946%]
  • unstable throughput [-641.474op/s; +570.227op/s] or [-18.356%; +16.317%]

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

  • unstable cpu_user_time [-2.146s; +4.624s] or [-21.469%; +46.260%]
  • unstable execution_time [-2.180s; +4.685s] or [-20.361%; +43.762%]
  • unstable instructions [-18.8G instructions; +41.0G instructions] or [-22.568%; +49.194%]
  • unstable max_rss_usage [-7.262MB; +14.363MB] or [-4.508%; +8.915%]
  • unstable throughput [-1014.837op/s; +470.414op/s] or [-32.473%; +15.053%]

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

  • unstable cpu_user_time [-3012.027ms; +3714.643ms] or [-29.864%; +36.830%]
  • unstable execution_time [-3038.044ms; +3783.342ms] or [-28.167%; +35.077%]
  • unstable instructions [-25.7G instructions; +32.3G instructions] or [-30.978%; +38.938%]
  • unstable max_rss_usage [-11616.409KB; +12670.009KB] or [-7.121%; +7.767%]
  • unstable throughput [-936.651op/s; +748.729op/s] or [-29.661%; +23.710%]

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

  • unstable cpu_user_time [-2181.546ms; +3323.218ms] or [-23.522%; +35.832%]
  • unstable execution_time [-2222.863ms; +3364.872ms] or [-22.324%; +33.792%]
  • unstable instructions [-19.5G instructions; +29.7G instructions] or [-25.152%; +38.342%]
  • unstable throughput [-742.179op/s; +510.764op/s] or [-22.457%; +15.455%]

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

  • unstable cpu_user_time [-1698.040ms; +565.474ms] or [-21.421%; +7.133%]
  • unstable execution_time [-1733.488ms; +578.317ms] or [-20.127%; +6.715%]
  • unstable instructions [-14.7G instructions; +4.8G instructions] or [-22.684%; +7.417%]
  • unstable throughput [-170.110op/s; +499.076op/s] or [-4.430%; +12.997%]

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

  • unstable cpu_user_time [-2.106s; +4.570s] or [-21.128%; +45.860%]
  • unstable execution_time [-2.114s; +4.602s] or [-19.828%; +43.152%]
  • unstable instructions [-18.9G instructions; +41.2G instructions] or [-22.673%; +49.454%]
  • unstable max_rss_usage [-7.242MB; +14.516MB] or [-4.509%; +9.039%]
  • unstable throughput [-1008.807op/s; +458.594op/s] or [-32.196%; +14.636%]

scenario:dogstatsd-with-tags-20

  • unstable cpu_user_time [-335.295ms; +259.178ms] or [-7.164%; +5.537%]
  • unstable execution_time [-336.275ms; +259.329ms] or [-7.070%; +5.452%]
  • unstable throughput [-90125.636op/s; +114482.949op/s] or [-5.115%; +6.497%]

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

  • unstable max_rss_usage [-26.487MB; +15.527MB] or [-7.003%; +4.106%]

@juan-fernandez
juan-fernandez enabled auto-merge (squash) July 6, 2026 12:36
@juan-fernandez
juan-fernandez merged commit 53195e0 into master Jul 6, 2026
653 checks passed
@juan-fernandez
juan-fernandez deleted the juan-fernandez/fix-testopt-browser-flakes branch July 6, 2026 12:49
This was referenced Jul 6, 2026
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