Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(jest-preset): to remove unhandled promise lockfile #1962

Merged
merged 2 commits into from
Jan 10, 2021

Conversation

tdeekens
Copy link
Contributor

@tdeekens tdeekens commented Jan 9, 2021

Summary

This pull request suggests to remove the fail-tests-because-there-was-an-unhandled-rejection.lock file which is written when a unhandled promise rejection is detected by the Node.js process.

Description

Jest can spawn various processes. This often made it hard to catch all unhandled promise rejections as some could originate in child processes and not communicate proper to the parent. As a result unhandled promise rejections might have gotten unnoticed when running a large test suite on machines with various cores.

The linked issue jestjs/jest#3251 (comment) discusses this at length.

However, in recent versions of Node.js unhandled promises will always immediately terminate the process. In addition in this jestjs/jest#4016 pull request the limitation causing the need for this, to my understanding, has been solved.

The resulting fix was available in Jest as of v21. The earliest visible blame on these lines in our preset are 3 year old. Before this was internal and existed. I suspect we just carried this forward but might not need it anymore.

@vercel
Copy link

vercel bot commented Jan 9, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/commercetools/merchant-center-application-kit/64gawrj8h
✅ Preview: https://merchant-cente-git-refactor-remove-promise-lo-86e670.commercetools.vercel.app

@changeset-bot
Copy link

changeset-bot bot commented Jan 9, 2021

🦋 Changeset detected

Latest commit: 041f8df

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@commercetools-frontend/jest-preset-mc-app Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@tdeekens tdeekens requested a review from emmenko January 9, 2021 23:52
@tdeekens tdeekens self-assigned this Jan 9, 2021
@tdeekens tdeekens added the 🙏 Status: Dev Review Waiting for technical reviews label Jan 9, 2021
@vercel vercel bot temporarily deployed to Preview January 9, 2021 23:53 Inactive
Copy link
Member

@emmenko emmenko left a comment

Choose a reason for hiding this comment

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

Good call, thanks!

@emmenko emmenko added the 🚀 Status: ship it Triggers an merge if rules match via bot label Jan 10, 2021
@kodiakhq kodiakhq bot merged commit e1794e6 into master Jan 10, 2021
@kodiakhq kodiakhq bot deleted the refactor/remove-promise-lock-file branch January 10, 2021 16:15
@ghost ghost mentioned this pull request Jan 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙏 Status: Dev Review Waiting for technical reviews 🚀 Status: ship it Triggers an merge if rules match via bot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants