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

[Bug]: 13.4.0 regression caused when process does not exist when running in Jest #8497

Closed
jimmydief opened this issue Jun 9, 2022 · 0 comments · Fixed by #8504
Closed

[Bug]: 13.4.0 regression caused when process does not exist when running in Jest #8497

jimmydief opened this issue Jun 9, 2022 · 0 comments · Fixed by #8504
Labels

Comments

@jimmydief
Copy link
Contributor

Bug description

Similar to #8476, I can only reproduce this when killing Puppeteer as part of the teardown logic of my Jest tests. The stack trace looks like this:

kill ESRCH
  at pidExists (node_modules/puppeteer/src/node/BrowserRunner.ts:331:20)
  at BrowserRunner.kill (node_modules/puppeteer/src/node/BrowserRunner.ts:190:39)
  at node_modules/puppeteer/src/node/BrowserRunner.ts:177:14

I believe that this is likely only reproducible in Jest due to jestjs/jest#2549. Regardless, the instanceof Error check here seems unnecessary. Given that Puppeteer is likely widely used in Jest, fixing this here seems practical.

if (error instanceof Error) {

Puppeteer version

13.4.0

Node.js version

14.16.1

npm version

6.14.12

What operating system are you seeing the problem on?

macOS

Relevant log output

No response

@jimmydief jimmydief added the bug label Jun 9, 2022
jimmydief added a commit to jimmydief/puppeteer that referenced this issue Jun 9, 2022
jimmydief added a commit to jimmydief/puppeteer that referenced this issue Jun 9, 2022
jimmydief added a commit to jimmydief/puppeteer that referenced this issue Jun 16, 2022
puppeteer#8497 does not seem to have been fully resolved for me with 14.4.0 (puppeteer#8504), likely because the `instanceof` check being changed in this PR also causes issues in Jest due to jestjs/jest#2549. I was able to confirm that this change avoids the error I've been seeing in CI by testing this change via `patch-package`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant