Skip to content

fix(playwright): handle disabled tests in serial retries#9313

Merged
juan-fernandez merged 4 commits into
masterfrom
juan-fernandez/fix-playwright-unknown-test-events
Jul 14, 2026
Merged

fix(playwright): handle disabled tests in serial retries#9313
juan-fernandez merged 4 commits into
masterfrom
juan-fernandez/fix-playwright-unknown-test-events

Conversation

@juan-fernandez

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

Copy link
Copy Markdown
Collaborator

What does this PR do?

Handles disabled tests that Playwright reintroduces while retrying a serial suite. Unknown worker events no longer crash the instrumentation, reintroduced disabled tests remain skipped in the worker, and their skipped/disabled test event is reported exactly once without duplicating disabled attempt-to-fix skips.

Motivation

Fixes #9308.

Test Management removes disabled tests from the initial dispatcher groups. When an enabled test in a serial suite fails and retries, Playwright rebuilds the retry candidates from the full serial suite and schedules the disabled sibling. Its worker then emits events for a test absent from Datadog's filtered test map. Both handlers dereferenced test.expectedStatus, crashing the Node.js process.

Ignoring the unknown events prevents the crash, but by itself allows the worker to execute the disabled test and report it as passing. This change carries disabled IDs in the retry payload so the worker preserves their skipped status, then uses the existing summary path to emit the skipped/disabled event. The fallback is limited to tests actually filtered from dispatcher groups so skipped disabled attempt-to-fix executions are not reported twice.

Additional Notes

The regression runs on Playwright >=1.39 because older versions do not yet ignore unknown worker events in Playwright's own dispatcher.

@dd-octo-sts

dd-octo-sts Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 6.71 MB
Deduped: 7.37 MB
No deduping: 7.37 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-prod-us1-6

datadog-prod-us1-6 Bot commented Jul 13, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 96.57% (+0.01%)

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

@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.60%. Comparing base (c708123) to head (3544f04).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9313      +/-   ##
==========================================
+ Coverage   96.59%   96.60%   +0.01%     
==========================================
  Files         919      919              
  Lines      121692   121729      +37     
  Branches    20294    21025     +731     
==========================================
+ Hits       117549   117599      +50     
+ Misses       4143     4130      -13     
Flag Coverage Δ
aiguard 53.56% <ø> (-0.05%) ⬇️
aiguard-integration 57.01% <ø> (ø)
apm-bucket-0 53.79% <ø> (-0.05%) ⬇️
apm-bucket-1 58.07% <ø> (-0.05%) ⬇️
apm-bucket-2 56.11% <ø> (-0.05%) ⬇️
apm-capabilities-tracing 60.34% <ø> (+<0.01%) ⬆️
apm-integrations-aerospike 52.94% <ø> (-0.05%) ⬇️
apm-integrations-confluentinc-kafka-javascript 57.06% <ø> (-0.05%) ⬇️
apm-integrations-couchbase 53.27% <ø> (-0.05%) ⬇️
apm-integrations-http 57.96% <ø> (-0.04%) ⬇️
apm-integrations-kafkajs 57.71% <ø> (-0.05%) ⬇️
apm-integrations-next 54.24% <ø> (-0.05%) ⬇️
apm-integrations-prisma 54.17% <ø> (-0.05%) ⬇️
apm-integrations-tedious 53.04% <ø> (-0.05%) ⬇️
appsec 68.94% <ø> (-0.10%) ⬇️
appsec-express_fastify_graphql 65.68% <ø> (-0.05%) ⬇️
appsec-integration 51.96% <7.50%> (-0.03%) ⬇️
appsec-kafka_ldapjs_lodash 59.09% <ø> (-0.04%) ⬇️
appsec-mongodb-core_mongoose_mysql 62.25% <ø> (-0.04%) ⬇️
appsec-next 52.85% <ø> (-0.04%) ⬇️
appsec-node-serialize_passport_postgres 61.88% <ø> (-0.04%) ⬇️
appsec-sourcing_stripe_template 60.34% <ø> (-0.04%) ⬇️
debugger 65.70% <ø> (-0.02%) ⬇️
instrumentations-bucket-0 48.75% <ø> (-0.05%) ⬇️
instrumentations-bucket-1 54.96% <ø> (-0.05%) ⬇️
instrumentations-bucket-10 56.62% <ø> (-0.05%) ⬇️
instrumentations-bucket-11 48.74% <ø> (-0.05%) ⬇️
instrumentations-bucket-12 48.85% <ø> (-0.05%) ⬇️
instrumentations-bucket-13 48.68% <ø> (-0.05%) ⬇️
instrumentations-bucket-2 49.75% <ø> (-0.05%) ⬇️
instrumentations-bucket-3 53.83% <ø> (-0.05%) ⬇️
instrumentations-bucket-4 49.16% <ø> (-0.05%) ⬇️
instrumentations-bucket-5 53.01% <ø> (-0.05%) ⬇️
instrumentations-bucket-6 55.60% <ø> (-0.05%) ⬇️
instrumentations-bucket-7 53.61% <ø> (-0.05%) ⬇️
instrumentations-bucket-8 54.64% <ø> (-0.05%) ⬇️
instrumentations-bucket-9 56.10% <ø> (-0.04%) ⬇️
instrumentations-instrumentation-couchbase 48.18% <ø> (-0.05%) ⬇️
instrumentations-integration-esbuild 33.96% <7.50%> (-0.02%) ⬇️
llmobs-ai_anthropic_bedrock 57.73% <ø> (-0.04%) ⬇️
llmobs-bucket-1 56.98% <ø> (-0.04%) ⬇️
llmobs-openai 57.56% <ø> (-0.04%) ⬇️
llmobs-sdk 59.95% <ø> (-0.05%) ⬇️
llmobs-vertex-ai 54.20% <ø> (-0.06%) ⬇️
master-coverage 96.60% <100.00%> (?)
openfeature 54.62% <ø> (-0.01%) ⬇️
openfeature-unit 49.83% <ø> (-0.05%) ⬇️
platform-core_esbuild_instrumentations-misc 38.45% <7.50%> (-0.05%) ⬇️
platform-integration 62.23% <ø> (+0.04%) ⬆️
platform-shimmer_unit-guardrails_webpack 37.28% <7.50%> (-0.05%) ⬇️
plugins-azure-event-hubs_body-parser_bullmq ?
plugins-bucket-0 53.18% <ø> (-0.05%) ⬇️
plugins-bucket-1 55.08% <ø> (?)
plugins-bucket-11 55.60% <ø> (-1.17%) ⬇️
plugins-bucket-17 ?
plugins-bucket-18 57.07% <ø> (-0.50%) ⬇️
plugins-bucket-19 55.35% <ø> (-1.83%) ⬇️
plugins-bucket-20 57.44% <ø> (-1.96%) ⬇️
plugins-bucket-3 ?
plugins-bucket-4 53.85% <ø> (?)
plugins-bullmq_cassandra_cookie 57.36% <ø> (?)
plugins-cassandra_cookie_cookie-parser ?
plugins-cookie-parser_crypto_dd-trace-api 52.32% <ø> (?)
plugins-express-session_fastify_fetch ?
plugins-fetch_fs_generic-pool 54.46% <ø> (?)
plugins-fs_generic-pool_google-cloud-pubsub ?
plugins-google-cloud-pubsub_grpc_handlebars 59.86% <ø> (?)
plugins-grpc_handlebars_hapi ?
plugins-hapi_hono_ioredis 55.86% <ø> (?)
plugins-hono_ioredis_jest ?
plugins-jest_knex_langgraph 51.67% <ø> (?)
plugins-knex_langgraph_ldapjs ?
plugins-ldapjs_light-my-request_limitd-client 53.42% <ø> (?)
plugins-light-my-request_limitd-client_lodash ?
plugins-lodash_mariadb_memcached 54.21% <ø> (?)
plugins-mariadb_memcached_mercurius ?
plugins-moleculer_mongodb_mongodb-core 57.28% <ø> (?)
plugins-mongodb_mongodb-core_mongoose ?
plugins-mongoose_multer_mysql 54.71% <ø> (?)
plugins-multer_mysql_mysql2 ?
plugins-mysql2_nats_node-serialize 56.21% <ø> (?)
plugins-nats_node-serialize_opensearch ?
plugins-opensearch_passport-http_pino 55.05% <ø> (?)
plugins-passport-http_pino_postgres ?
plugins-postgres_process_pug 54.29% <ø> (?)
plugins-process_pug_redis ?
plugins-redis_router_sequelize 57.03% <ø> (?)
plugins-test-and-upstream-rhea_undici_url 57.00% <ø> (?)
plugins-undici_url_valkey ?
plugins-valkey_vm_winston 53.93% <ø> (?)
plugins-vm_winston_ws ?
plugins-ws 54.80% <ø> (?)
profiling 58.20% <ø> (-0.04%) ⬇️
serverless-aws-sdk-aws-sdk 50.67% <ø> (-0.04%) ⬇️
serverless-aws-sdk-bedrockruntime 50.69% <ø> (-0.05%) ⬇️
serverless-aws-sdk-client 51.97% <ø> (-0.05%) ⬇️
serverless-aws-sdk-dynamodb 51.78% <ø> (-0.02%) ⬇️
serverless-aws-sdk-eventbridge 46.26% <ø> (-0.05%) ⬇️
serverless-aws-sdk-kinesis 54.71% <ø> (-0.05%) ⬇️
serverless-aws-sdk-lambda 52.79% <ø> (-0.05%) ⬇️
serverless-aws-sdk-s3 51.54% <ø> (-0.05%) ⬇️
serverless-aws-sdk-serverless-peer-service 54.73% <ø> (-0.05%) ⬇️
serverless-aws-sdk-sns 55.48% <ø> (-0.05%) ⬇️
serverless-aws-sdk-sqs 55.91% <ø> (-0.05%) ⬇️
serverless-aws-sdk-stepfunctions 51.25% <ø> (-0.05%) ⬇️
serverless-aws-sdk-util 48.48% <ø> (-0.05%) ⬇️
serverless-bucket-0 55.23% <ø> (ø)
serverless-bucket-1 56.01% <ø> (-0.05%) ⬇️
test-optimization-cucumber 72.94% <ø> (-0.02%) ⬇️
test-optimization-cypress 66.33% <ø> (+0.01%) ⬆️
test-optimization-jest 74.25% <ø> (-0.03%) ⬇️
test-optimization-mocha 74.69% <ø> (+0.06%) ⬆️
test-optimization-playwright-playwright-atr 61.62% <50.00%> (+0.08%) ⬆️
test-optimization-playwright-playwright-efd 61.74% <50.00%> (+0.08%) ⬆️
test-optimization-playwright-playwright-final-status 61.72% <80.00%> (+<0.01%) ⬆️
test-optimization-playwright-playwright-impacted-tests 61.42% <47.50%> (+0.14%) ⬆️
test-optimization-playwright-playwright-reporting 61.33% <50.00%> (+0.01%) ⬆️
test-optimization-playwright-playwright-test-management 62.29% <100.00%> (-0.24%) ⬇️
test-optimization-playwright-playwright-test-span 61.46% <50.00%> (-0.08%) ⬇️
test-optimization-selenium 60.66% <ø> (-0.14%) ⬇️
test-optimization-testopt 59.14% <47.50%> (+0.07%) ⬆️
test-optimization-vitest 71.58% <ø> (+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.

@pr-commenter

pr-commenter Bot commented Jul 13, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-14 06:34:04

Comparing candidate commit 3544f04 in PR branch juan-fernandez/fix-playwright-unknown-test-events with baseline commit c708123 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 2313 metrics, 45 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 [-211.392ms; +207.934ms] or [-7.934%; +7.804%]

scenario:appsec-appsec-enabled-26

  • unstable execution_time [-235.885ms; +206.162ms] or [-9.316%; +8.142%]

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

  • unstable execution_time [-162.496ms; +157.702ms] or [-5.261%; +5.106%]

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

  • unstable execution_time [-184.032ms; +189.370ms] or [-6.268%; +6.450%]

scenario:appsec-control-20

  • unstable execution_time [-117.233ms; +127.664ms] or [-7.107%; +7.739%]

scenario:appsec-control-24

  • unstable execution_time [-114453.123µs; +113190.923µs] or [-9.241%; +9.139%]

scenario:appsec-control-26

  • unstable execution_time [-133.468ms; +112.898ms] or [-10.886%; +9.208%]

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

  • unstable execution_time [-30.618ms; +40.715ms] or [-5.559%; +7.393%]

scenario:debugger-enabled-but-breakpoint-not-hit-24

  • unstable execution_time [-660.182ms; +940.071ms] or [-5.763%; +8.207%]
  • unstable throughput [-1411.519op/s; +1003.965op/s] or [-7.325%; +5.210%]

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

  • unstable cpu_user_time [-2333.346ms; +3239.960ms] or [-25.182%; +34.967%]
  • unstable execution_time [-2315.740ms; +3258.027ms] or [-23.230%; +32.682%]
  • unstable instructions [-20.4G instructions; +28.0G instructions] or [-26.845%; +36.790%]
  • unstable max_rss_usage [-9.652MB; +13.258MB] or [-6.028%; +8.279%]
  • unstable throughput [-922.372op/s; +662.000op/s] or [-27.438%; +19.693%]

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

  • unstable cpu_user_time [-1936.591ms; +2921.172ms] or [-22.870%; +34.497%]
  • unstable execution_time [-1972.348ms; +2953.358ms] or [-21.464%; +32.140%]
  • unstable instructions [-16.9G instructions; +25.5G instructions] or [-24.343%; +36.866%]
  • unstable max_rss_usage [-8.512MB; +12.709MB] or [-5.424%; +8.098%]
  • unstable throughput [-782.921op/s; +547.242op/s] or [-21.904%; +15.311%]

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

  • unstable cpu_user_time [-2069.716ms; +3269.833ms] or [-22.062%; +34.854%]
  • unstable execution_time [-2050.152ms; +3278.543ms] or [-20.299%; +32.461%]
  • unstable instructions [-18.5G instructions; +29.5G instructions] or [-23.653%; +37.773%]
  • unstable max_rss_usage [-7.151MB; +10.468MB] or [-4.485%; +6.566%]
  • unstable throughput [-715.641op/s; +446.586op/s] or [-22.033%; +13.749%]

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

  • unstable cpu_user_time [-2573.212ms; +2621.119ms] or [-28.720%; +29.255%]
  • unstable execution_time [-2582.714ms; +2634.305ms] or [-26.707%; +27.241%]
  • unstable instructions [-22209.3M instructions; +22292.0M instructions] or [-30.190%; +30.303%]
  • unstable max_rss_usage [-11083.351KB; +11920.151KB] or [-6.957%; +7.482%]
  • unstable throughput [-693.650op/s; +700.895op/s] or [-20.135%; +20.345%]

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

  • unstable cpu_user_time [-1.315s; +4.937s] or [-11.139%; +41.819%]
  • unstable execution_time [-1.358s; +5.008s] or [-10.824%; +39.930%]
  • unstable instructions [-11.5G instructions; +43.9G instructions] or [-11.551%; +43.933%]
  • unstable max_rss_usage [-3.983MB; +16.298MB] or [-2.395%; +9.799%]
  • unstable throughput [-1088.664op/s; +305.982op/s] or [-40.028%; +11.250%]

scenario:dogstatsd-with-tags-20

  • unstable cpu_user_time [-219.685ms; +368.141ms] or [-4.368%; +7.320%]
  • unstable execution_time [-219.602ms; +364.383ms] or [-4.302%; +7.138%]
  • unstable throughput [-125528.143op/s; +73389.872op/s] or [-7.645%; +4.469%]

scenario:id-parse-128bit-20

  • unstable execution_time [-122.391ms; +187.980ms] or [-4.528%; +6.955%]

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

  • unstable cpu_user_time [-173.776ms; +248.226ms] or [-4.513%; +6.446%]
  • unstable execution_time [-174.263ms; +248.180ms] or [-4.496%; +6.404%]

scenario:plugin-claude-agent-sdk-compact-stream-scan-24

  • unstable cpu_usage_percentage [-2.052%; +8.031%]

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

  • unstable cpu_user_time [-696.364ms; +716.674ms] or [-5.439%; +5.597%]
  • unstable execution_time [-695.173ms; +715.552ms] or [-5.314%; +5.470%]
  • unstable throughput [-3.319op/s; +3.211op/s] or [-5.395%; +5.220%]

@juan-fernandez

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bb725a5cca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/datadog-instrumentations/src/playwright.js
@juan-fernandez juan-fernandez changed the title fix(playwright): ignore events for unknown tests fix(playwright): handle disabled tests in serial retries Jul 13, 2026
@juan-fernandez

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: fb2f80be65

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@juan-fernandez
juan-fernandez marked this pull request as ready for review July 13, 2026 23:08
@juan-fernandez
juan-fernandez requested a review from a team as a code owner July 13, 2026 23:08

@datadog-prod-us1-6 datadog-prod-us1-6 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 correctly fixes a crash in serial retry scenarios where disabled test siblings reappear in the worker. The fix adds early returns for unknown test events, tracks disabled test IDs through retry payloads, and marks reintroduced disabled tests as skipped before execution. Code analysis and synthetic validation confirm no regressions in normal test paths and correct handling of the disabled sibling scenario.

Was this helpful? React 👍 or 👎

📊 Validated against 6 scenarios · Open Bits AI session

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

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fb2f80be65

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/datadog-instrumentations/src/playwright.js Outdated
@juan-fernandez

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 3544f048d8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@juan-fernandez
juan-fernandez merged commit 95b80c1 into master Jul 14, 2026
692 of 693 checks passed
@juan-fernandez
juan-fernandez deleted the juan-fernandez/fix-playwright-unknown-test-events branch July 14, 2026 08:47
@dd-octo-sts dd-octo-sts Bot mentioned this pull request Jul 14, 2026
This was referenced Jul 14, 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.

[BUG]: error destructuring property for playwright instrumentation

2 participants