Skip to content

fix(vitest): propagate no-worker request error tags#9189

Merged
juan-fernandez merged 2 commits into
masterfrom
juan-fernandez/vitest-no-worker-request-error-tags
Jul 3, 2026
Merged

fix(vitest): propagate no-worker request error tags#9189
juan-fernandez merged 2 commits into
masterfrom
juan-fernandez/vitest-no-worker-request-error-tags

Conversation

@juan-fernandez

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

Copy link
Copy Markdown
Collaborator

What does this PR do?

Propagates Test Optimization request error tags through Vitest no-worker-init reporting.

Specifically, this returns the current request error tags from settings, known-tests, and test-management requests, stores them in Vitest main no-worker state, and forwards them to no-worker session, suite, and test events, including skipped tests.

Motivation

When a Test Optimization request fails, normal worker instrumentation tags emitted events with the request error. No-worker-init reporting should keep that diagnostic signal on the same event types even when worker instrumentation is skipped.

@dd-octo-sts

dd-octo-sts Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 6.52 MB
Deduped: 7.59 MB
No deduping: 7.59 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

@juan-fernandez

Copy link
Copy Markdown
Collaborator Author

@codex review

@pr-commenter

pr-commenter Bot commented Jul 2, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-02 15:06:38

Comparing candidate commit baec21e in PR branch juan-fernandez/vitest-no-worker-request-error-tags with baseline commit 9e5845e 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-24

  • unstable execution_time [-174.945ms; +178.470ms] or [-6.654%; +6.788%]

scenario:appsec-appsec-enabled-26

  • unstable execution_time [-195.679ms; +208.990ms] or [-7.804%; +8.335%]

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

  • unstable execution_time [-148282.416µs; +150140.016µs] or [-5.150%; +5.214%]

scenario:appsec-control-20

  • unstable execution_time [-169.045ms; +158.976ms] or [-9.641%; +9.066%]

scenario:appsec-control-24

  • unstable execution_time [-101366.573µs; +99509.273µs] or [-8.388%; +8.234%]

scenario:appsec-control-26

  • unstable execution_time [-111.037ms; +113.891ms] or [-9.189%; +9.425%]

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

  • unstable cpu_user_time [-2862.944ms; +4149.117ms] or [-27.194%; +39.411%]
  • unstable execution_time [-2874.162ms; +4156.935ms] or [-25.562%; +36.971%]
  • unstable instructions [-25.6G instructions; +37.3G instructions] or [-28.984%; +42.206%]
  • unstable max_rss_usage [-8.829MB; +12.357MB] or [-5.418%; +7.583%]
  • unstable throughput [-922.022op/s; +630.330op/s] or [-30.568%; +20.897%]

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

  • unstable cpu_user_time [-3432.977ms; +2221.270ms] or [-37.894%; +24.519%]
  • unstable execution_time [-3455.756ms; +2252.985ms] or [-35.445%; +23.108%]
  • unstable instructions [-28.8G instructions; +18.8G instructions] or [-38.794%; +25.362%]
  • unstable max_rss_usage [-11.709MB; +7.737MB] or [-7.202%; +4.759%]
  • unstable throughput [-659.657op/s; +1014.518op/s] or [-18.800%; +28.914%]

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

  • unstable cpu_user_time [-2945773.475µs; +2944212.275µs] or [-29.651%; +29.636%]
  • unstable execution_time [-2937.857ms; +2971.025ms] or [-27.671%; +27.984%]
  • unstable instructions [-26072.4M instructions; +26091.4M instructions] or [-31.371%; +31.393%]
  • unstable max_rss_usage [-8504.150KB; +9720.950KB] or [-5.276%; +6.031%]
  • unstable throughput [-657.419op/s; +644.729op/s] or [-20.843%; +20.440%]

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

  • unstable cpu_user_time [-1893.562ms; +2984.233ms] or [-23.952%; +37.748%]
  • unstable execution_time [-1901.119ms; +2999.126ms] or [-22.135%; +34.920%]
  • unstable instructions [-15.8G instructions; +25.2G instructions] or [-24.653%; +39.185%]
  • unstable max_rss_usage [-6.729MB; +11.386MB] or [-4.247%; +7.187%]
  • unstable throughput [-887.742op/s; +564.988op/s] or [-23.111%; +14.709%]

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

  • unstable cpu_user_time [-2039.187ms; +3248.514ms] or [-21.773%; +34.685%]
  • unstable execution_time [-2071.676ms; +3285.845ms] or [-20.566%; +32.620%]
  • unstable instructions [-18.5G instructions; +29.4G instructions] or [-23.696%; +37.696%]
  • unstable max_rss_usage [-8.555MB; +11.009MB] or [-5.428%; +6.985%]
  • unstable throughput [-717.208op/s; +454.059op/s] or [-22.018%; +13.940%]

scenario:dogstatsd-with-tags-20

  • unstable cpu_user_time [-196.486ms; +445.127ms] or [-3.927%; +8.897%]
  • unstable execution_time [-199.316ms; +445.513ms] or [-3.927%; +8.778%]
  • unstable throughput [-153856.091op/s; +67289.529op/s] or [-9.299%; +4.067%]

scenario:log-with-debug-20

  • unstable max_rss_usage [-8.144MB; +4.923MB] or [-7.120%; +4.304%]

scenario:plugin-couchbase-upsert-24

  • unstable cpu_user_time [-197.725ms; +373.477ms] or [-4.330%; +8.179%]
  • unstable execution_time [-198.478ms; +374.179ms] or [-4.340%; +8.183%]

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

  • unstable max_rss_usage [-27.470MB; +19.012MB] or [-7.228%; +5.003%]

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

  • unstable max_rss_usage [-7671.255KB; +7599.827KB] or [-5.910%; +5.855%]

@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: 556ed47b6f

ℹ️ 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/vitest-main.js
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.23529% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.65%. Comparing base (9e5845e) to head (baec21e).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...ckages/datadog-instrumentations/src/vitest-main.js 80.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9189      +/-   ##
==========================================
+ Coverage   93.63%   93.65%   +0.01%     
==========================================
  Files         896      898       +2     
  Lines       52220    52371     +151     
  Branches    12265    12322      +57     
==========================================
+ Hits        48895    49046     +151     
  Misses       3325     3325              
Flag Coverage Δ
aiguard 34.98% <0.00%> (+0.04%) ⬆️
aiguard-integration 41.96% <0.00%> (+<0.01%) ⬆️
apm-bucket-0 34.85% <0.00%> (-0.06%) ⬇️
apm-bucket-1 40.52% <0.00%> (-0.06%) ⬇️
apm-bucket-2 37.51% <0.00%> (-0.06%) ⬇️
apm-capabilities-tracing 48.87% <0.00%> (+0.09%) ⬆️
apm-integrations-aerospike 33.13% <0.00%> (-0.06%) ⬇️
apm-integrations-confluentinc-kafka-javascript 40.03% <0.00%> (-0.07%) ⬇️
apm-integrations-couchbase 33.42% <0.00%> (+0.10%) ⬆️
apm-integrations-http 42.06% <0.00%> (-0.06%) ⬇️
apm-integrations-kafkajs 40.27% <0.00%> (-0.10%) ⬇️
apm-integrations-next 29.63% <0.00%> (-0.06%) ⬇️
apm-integrations-prisma 35.19% <0.00%> (-0.06%) ⬇️
apm-integrations-tedious 34.05% <0.00%> (-0.06%) ⬇️
appsec 57.94% <0.00%> (-0.03%) ⬇️
appsec-express_fastify_graphql 53.85% <0.00%> (-0.06%) ⬇️
appsec-integration 35.68% <5.88%> (+<0.01%) ⬆️
appsec-kafka_ldapjs_lodash 43.76% <0.00%> (-0.06%) ⬇️
appsec-mongodb-core_mongoose_mysql 48.92% <0.00%> (-0.05%) ⬇️
appsec-next 28.12% <0.00%> (-0.05%) ⬇️
appsec-node-serialize_passport_postgres 48.14% <0.00%> (-0.01%) ⬇️
appsec-sourcing_stripe_template 45.64% <0.00%> (-0.05%) ⬇️
debugger 44.63% <0.00%> (+0.29%) ⬆️
instrumentations-bucket-0 28.17% <0.00%> (-0.06%) ⬇️
instrumentations-bucket-1 37.58% <0.00%> (-0.06%) ⬇️
instrumentations-bucket-10 40.52% <0.00%> (-0.06%) ⬇️
instrumentations-bucket-11 27.97% <0.00%> (-0.06%) ⬇️
instrumentations-bucket-12 28.80% <0.00%> (-0.06%) ⬇️
instrumentations-bucket-13 27.80% <0.00%> (-0.06%) ⬇️
instrumentations-bucket-2 30.37% <0.00%> (-0.06%) ⬇️
instrumentations-bucket-3 36.07% <0.00%> (-0.06%) ⬇️
instrumentations-bucket-4 28.58% <0.00%> (-0.06%) ⬇️
instrumentations-bucket-5 36.43% <0.00%> (-0.06%) ⬇️
instrumentations-bucket-6 38.43% <0.00%> (-0.06%) ⬇️
instrumentations-bucket-7 36.17% <0.00%> (-0.06%) ⬇️
instrumentations-bucket-8 37.12% <0.00%> (-0.06%) ⬇️
instrumentations-bucket-9 39.62% <0.00%> (-0.06%) ⬇️
instrumentations-instrumentation-couchbase 46.48% <ø> (ø)
instrumentations-integration-esbuild 24.50% <5.88%> (+<0.01%) ⬆️
llmobs-ai_anthropic_bedrock 39.69% <0.00%> (-0.05%) ⬇️
llmobs-google-genai_langchain_vertex-ai 37.11% <0.00%> (-0.05%) ⬇️
llmobs-openai 39.75% <0.00%> (-0.06%) ⬇️
llmobs-sdk 43.60% <0.00%> (-0.07%) ⬇️
master-coverage 93.65% <88.23%> (?)
openfeature 37.94% <0.00%> (+0.01%) ⬆️
openfeature-unit 50.47% <ø> (+0.07%) ⬆️
platform-core_esbuild_instrumentations-misc 22.96% <5.88%> (+<0.01%) ⬆️
platform-integration 47.58% <0.00%> (-0.04%) ⬇️
platform-shimmer_unit-guardrails_webpack 18.48% <10.00%> (-0.02%) ⬇️
plugins-bucket-0 36.53% <0.00%> (-0.05%) ⬇️
plugins-bucket-1 39.78% <0.00%> (+0.01%) ⬆️
plugins-bucket-11 38.64% <0.00%> (-0.06%) ⬇️
plugins-bucket-17 39.33% <0.00%> (-0.06%) ⬇️
plugins-bucket-18 42.19% <0.00%> (-0.06%) ⬇️
plugins-bucket-19 39.74% <0.00%> (-0.06%) ⬇️
plugins-bucket-20 43.45% <0.00%> (-0.06%) ⬇️
plugins-bucket-4 37.88% <0.00%> (-0.06%) ⬇️
plugins-bullmq_cassandra_cookie 39.94% <0.00%> (-0.06%) ⬇️
plugins-cookie-parser_crypto_dd-trace-api 33.23% <0.00%> (-0.06%) ⬇️
plugins-fetch_fs_generic-pool 36.22% <0.00%> (-0.06%) ⬇️
plugins-google-cloud-pubsub_grpc_handlebars 43.10% <0.00%> (-0.06%) ⬇️
plugins-hapi_hono_ioredis 37.95% <0.00%> (-0.06%) ⬇️
plugins-jest_knex_langgraph 32.62% <0.00%> (-0.06%) ⬇️
plugins-ldapjs_light-my-request_limitd-client 27.93% <0.00%> (+<0.01%) ⬆️
plugins-lodash_mariadb_memcached 35.18% <0.00%> (-0.06%) ⬇️
plugins-mongodb_mongodb-core_mongoose 36.47% <0.00%> (-0.06%) ⬇️
plugins-multer_mysql_mysql2 35.16% <0.00%> (-0.06%) ⬇️
plugins-nats_node-serialize_opensearch 37.32% <0.00%> (-0.06%) ⬇️
plugins-passport-http_pino_postgres 35.54% <0.00%> (-0.06%) ⬇️
plugins-process_pug_redis 34.27% <0.00%> (-0.06%) ⬇️
plugins-undici_url_valkey 36.04% <0.00%> (-0.06%) ⬇️
plugins-vm_winston_ws 37.73% <0.00%> (-0.06%) ⬇️
profiling 43.81% <0.00%> (-0.06%) ⬇️
serverless-aws-sdk-aws-sdk 33.43% <0.00%> (-0.05%) ⬇️
serverless-aws-sdk-bedrockruntime 32.29% <0.00%> (-0.05%) ⬇️
serverless-aws-sdk-client 37.16% <ø> (ø)
serverless-aws-sdk-dynamodb 34.29% <0.00%> (+<0.01%) ⬆️
serverless-aws-sdk-eventbridge 27.36% <0.00%> (-0.05%) ⬇️
serverless-aws-sdk-kinesis 37.56% <0.00%> (-0.06%) ⬇️
serverless-aws-sdk-lambda 34.74% <0.00%> (-0.05%) ⬇️
serverless-aws-sdk-s3 32.73% <0.00%> (-0.05%) ⬇️
serverless-aws-sdk-serverless-peer-service 39.67% <0.00%> (-0.07%) ⬇️
serverless-aws-sdk-sns 38.42% <0.00%> (-0.06%) ⬇️
serverless-aws-sdk-sqs 38.16% <0.00%> (-0.22%) ⬇️
serverless-aws-sdk-stepfunctions 33.32% <0.00%> (-0.05%) ⬇️
serverless-aws-sdk-util 47.95% <ø> (ø)
serverless-bucket-0 39.63% <0.00%> (+0.01%) ⬆️
serverless-lambda 34.35% <0.00%> (-0.07%) ⬇️
test-optimization-cucumber 52.55% <85.71%> (+0.12%) ⬆️
test-optimization-cypress 49.63% <0.00%> (+0.07%) ⬆️
test-optimization-jest 55.58% <100.00%> (+0.14%) ⬆️
test-optimization-mocha 53.62% <85.71%> (+0.08%) ⬆️
test-optimization-playwright-playwright-atr 43.53% <71.42%> (+0.10%) ⬆️
test-optimization-playwright-playwright-efd 43.82% <71.42%> (+0.10%) ⬆️
test-optimization-playwright-playwright-final-status 43.92% <85.71%> (+0.07%) ⬆️
test-optimization-playwright-playwright-impacted-tests 43.36% <71.42%> (+0.01%) ⬆️
test-optimization-playwright-playwright-reporting 43.47% <85.71%> (+0.10%) ⬆️
test-optimization-playwright-playwright-test-management 44.94% <85.71%> (+0.10%) ⬆️
test-optimization-playwright-playwright-test-span 44.72% <71.42%> (+0.09%) ⬆️
test-optimization-selenium 45.44% <57.14%> (+0.07%) ⬆️
test-optimization-testopt 46.81% <35.29%> (+0.08%) ⬆️
test-optimization-vitest 52.74% <88.23%> (+0.13%) ⬆️

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.

@datadog-prod-us1-4

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

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 88.24%
Overall Coverage: 87.87% (+0.01%)

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

@juan-fernandez

Copy link
Copy Markdown
Collaborator Author

@codex review

@juan-fernandez

Copy link
Copy Markdown
Collaborator Author

/datadog autotest review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: baec21e753

ℹ️ 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 2, 2026 15:18
@juan-fernandez
juan-fernandez requested review from a team as code owners July 2, 2026 15:18
@juan-fernandez
juan-fernandez requested review from bojbrook and removed request for a team July 2, 2026 15:18

@datadog-prod-us1-4 datadog-prod-us1-4 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 propagates Test Optimization request error tags to no-worker-init reporting. The implementation extracts tags from all request types (settings, known tests, test management), accumulates them in a module-level variable, and applies them to session, suite, and test events. No behavioral regressions detected.

Was this helpful? React 👍 or 👎

Open Bits AI session

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

@juan-fernandez
juan-fernandez merged commit 615ae32 into master Jul 3, 2026
653 of 654 checks passed
@juan-fernandez
juan-fernandez deleted the juan-fernandez/vitest-no-worker-request-error-tags branch July 3, 2026 08:28
@dd-octo-sts dd-octo-sts Bot mentioned this pull request Jul 6, 2026
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