fix(jest): support test.concurrent#9209
Conversation
Overall package sizeSelf size: 6.57 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 |
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: b16cf2c | Docs | Datadog PR Page | Give us feedback! |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #9209 +/- ##
==========================================
- Coverage 93.65% 93.55% -0.10%
==========================================
Files 899 900 +1
Lines 52483 52941 +458
Branches 12353 12491 +138
==========================================
+ Hits 49154 49531 +377
- Misses 3329 3410 +81 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
BenchmarksBenchmark execution time: 2026-07-06 21:53:22 Comparing candidate commit b16cf2c in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 2255 metrics, 31 unstable metrics.
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 70eec94852
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c72f781fd7
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 639be9b4a2
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 31604acd99
ℹ️ 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".
|
/datadog autotest review |
There was a problem hiding this comment.
Two isModified false-negative bugs in the concurrent test support code. wrapConcurrentTestFunction registers tests with a shimmer wrapper whose toString() spans only 3–4 lines; both the add_test retry-scheduling path and the test_start retry overwrite path use this narrow wrapper instead of the original user fn to compute the modified-line range. Any modification beyond the test declaration line is silently missed, so impacted test.concurrent tests with multi-line bodies are never retried — confirmed by synthetic execution showing endLine = startLine+3 vs. endLine = startLine+7 for an 8-line test body with the modification at startLine+4.
📊 Validated against 15 scenarios · Open Bits AI session
🤖 Datadog Autotest · Commit 1ecf010 · What is Autotest? · Any feedback? Reach out in #autotest
|
/datadog autotest review |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 383b888606
ℹ️ 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".
There was a problem hiding this comment.
More details
The ATR/FTR flag separation and concurrent context-propagation machinery are correctly implemented. The FIFO context queue handles duplicate test names safely, retries recover the correct span context via originalTestFns restore + WeakMap lookup, and the hasConcurrentTests flag is set during the describe phase — well before any test_done events — so FTR gating is always computed on complete information. One minor sentinel issue exists in getJestEachBind (using undefined for both "not-loaded" and "not-found" states causes redundant require attempts when jest-each is absent), but jest-each is a hard Jest dependency so this is never triggered in practice.
📊 Validated against 8 scenarios · Open Bits AI session
🤖 Datadog Autotest · Commit 383b888 · What is Autotest? · Any feedback? Reach out in #autotest
…-concurrent-test-optimization # Conflicts: # integration-tests/jest/jest.core.spec.js
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 881b8af7b3
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cf10a6399d
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 92c873e61d
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b63c780a0d
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b2b40dab3b
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e48f377fda
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
What does this PR do?
Supports Jest
test.concurrentin Test Optimization by tracking concurrent test registrations and binding each concurrent test body to its own test span context.The instrumentation handles
test.concurrent,test.concurrent.each,test.concurrent.only.failing, duplicate concurrent test names, imported@jest/globals, and retry attempts. Table-driven concurrent tests preservetest.parametersfor each expanded row title, including placeholder-based names. Concurrent tests also participate in Test Management disabled-test handling and impacted-test detection/retry metadata.Motivation
Jest can run concurrent tests from the same file at the same time, so Test Optimization needs per-test context binding for that execution mode.
This brings Jest concurrent execution in line with the Test Optimization span/context model and with the existing Vitest concurrent-test behavior.
Additional Notes
Failed Test Replay remains disabled for any Jest test file that contains
test.concurrent. Auto Test Retry can still retry the tests, but debugger probe capture is skipped for that file because FTR needs a sequential active-test-span association.The concurrent-only integration coverage is gated to the latest Jest matrix so older fixture runs do not collect files that lack the required
test.concurrentAPIs.