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

fix: remove instanceof Error check causing issues in Jest #8498

Closed
wants to merge 1 commit into from

Conversation

jimmydief
Copy link
Contributor

What kind of change does this PR introduce?

Bug fix.

Did you add tests for your changes?

No.

If relevant, did you update the documentation?

N/A

Summary

Fixes #8497.

Does this PR introduce a breaking change?

No

Other information

@@ -330,12 +330,10 @@ function pidExists(pid: number): boolean {
try {
return process.kill(pid, 0);
} catch (error) {
if (error instanceof Error) {
Copy link
Contributor Author

@jimmydief jimmydief Jun 9, 2022

Choose a reason for hiding this comment

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

I believe that the instanceof Error check here is failing when running Puppeteer in Jest due to jestjs/jest#2549. This seems to be timing-dependent in my tests and I've had a hard time reproducing it outside of CI.

Given that process.kill(...) is part of the standard library, checking that it throws Errors seems unnecessary anyways.

@jimmydief jimmydief closed this Jun 10, 2022
@jimmydief jimmydief reopened this Jun 10, 2022
@OrKoN OrKoN requested a review from jrandolf June 10, 2022 05:33
@jrandolf
Copy link
Contributor

Closed in favor of #8504

@jrandolf jrandolf closed this Jun 10, 2022
@jimmydief jimmydief deleted the fix_esrch branch June 10, 2022 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: 13.4.0 regression caused when process does not exist when running in Jest
2 participants