Repository navigation
test_runner: use AsyncLocalStorage instead of async_hooks - #66795
Conversation
|
Review requested:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #66795 +/- ##
==========================================
- Coverage 90.52% 90.49% -0.03%
==========================================
Files 797 797
Lines 278220 278225 +5
Branches 53456 53458 +2
==========================================
- Hits 251857 251793 -64
- Misses 16751 16810 +59
- Partials 9612 9622 +10
🚀 New features to boost your workflow:
|
atlowChemi
left a comment
There was a problem hiding this comment.
LGTM, but let's also see bench affects
|
Benchmark results for Every benchmark that creates many tests is faster, and the gain grows with the number of tests:
Full output |
Track the test that owns the current async context with an AsyncLocalStorage instead of a createHook() init/destroy map. Signed-off-by: Matteo Collina <hello@matteocollina.com>
ef8d21b to
1f16984
Compare
atlowChemi
left a comment
There was a problem hiding this comment.
@mcollina this might be worth a
notable-change
|
The
notable-change
Please suggest a text for the release notes if you'd like to include a more detailed summary, then proceed to update the PR description with the text or a link to the notable change suggested text comment. Otherwise, the commit will be placed in the Other Notable Changes section. |
|
Landed in 6698675 |
Track the test that owns the current async context with an AsyncLocalStorage instead of a
createHook()init/destroy map, sonode:testno longer installs async hooks (including promise hooks) for every run.Test#runInAsyncScope()enters the test's context directly rather than wrappingAsyncResource#runInAsyncScope(), to avoid adding frames to user stack traces. The snapshot changes drop one<node-internal-frames>line, since that frame now lives in the test runner and is filtered out.Refs: #61030
AI generated, reviewed by me