Skip to content

fix: incorrectly setting the name of currently running concurrent test - #14335

Merged
SimenB merged 2 commits into
jestjs:mainfrom
dmitri-gb:fix-concurrent-snapshots
Jul 21, 2023
Merged

SimenB merged 2 commits into
jestjs:mainfrom
dmitri-gb:fix-concurrent-snapshots

Conversation

@dmitri-gb

Copy link
Copy Markdown
Contributor

Summary

There was a bug in my previous submission (#14139).

Test functions lose their async context when throttled by p-limit. This caused snapshot matchers not to work properly when the number of concurrent tests in a file was greater than the maxConcurrency config option (which is 5 by default).

The fix is to set AsyncLocalStorage inside the throttled function.

Test plan

Verified manually.

Test functions lose their async context when throttled by p-limit. This
caused snapshot matchers not to work properly when the number of
concurrent tests in a file was greater than the maxConcurrency config
option.

The fix is to set AsyncLocalStorage inside the throttled function.
@netlify

netlify Bot commented Jul 16, 2023 •

Copy link
Copy Markdown

✅ Deploy Preview for jestjs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 7a174cd
🔍 Latest deploy log https://app.netlify.com/sites/jestjs/deploys/64b4739ddfe6f3000806c99d
😎 Deploy Preview https://deploy-preview-14335--jestjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mrazauskas mrazauskas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Thanks.

@SimenB SimenB left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch!

@SimenB

SimenB commented Jul 27, 2023

Copy link
Copy Markdown
Member

@github-actions

Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants