[Bug]: Jest worker encountered 3 child process exceptions, exceeding retry limit

See original GitHub issue

Version

28.1.2

Steps to reproduce

https://github.com/shaobeichen/blog

yarn
yarn test:coverage

Expected behavior

no error

Actual behavior

$ yarn test:coverage yarn run v1.22.19 $ jest --coverage --maxWorkers 2 --unhandled-rejections=warn PASS src/components/abstract/toast/tests/toast.test.ts
√ 创建一个弹窗,持续3秒 (13 ms) √ 命令式调用,创建一个弹窗 (12 ms)

Running coverage on untested files…Failed to collect coverage from D:\work\blog\src\utils\request\base.ts
ERROR: Jest worker encountered 3 child process exceptions, exceeding retry limit
STACK: Error: Jest worker encountered 3 child process exceptions, exceeding retry limit at ChildProcessWorker.initialize (D:\work\blog\node_modules\jest-worker\build\workers\ChildProcessWorker.js:170:21) at ChildProcessWorker._onExit (D:\work\blog\node_modules\jest-worker\build\workers\ChildProcessWorker.js:254:12) at ChildProcess.emit (node:events:520:28) at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) Failed to collect coverage from D:\work\blog\src\utils\request\mofish.ts ERROR: Jest worker encountered 3 child process exceptions, exceeding retry limit STACK: Error: Jest worker encountered 3 child process exceptions, exceeding retry limit at ChildProcessWorker.initialize (D:\work\blog\node_modules\jest-worker\build\workers\ChildProcessWorker.js:170:21) at ChildProcessWorker._onExit (D:\work\blog\node_modules\jest-worker\build\workers\ChildProcessWorker.js:254:12) at ChildProcess.emit (node:events:520:28) at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) -------------------------------|---------|----------|---------|---------|-------------------

File % Stmts % Branch % Funcs % Lines Uncovered Line #s
All files 20.86 30 15.38 20.83
src 0 100 100 0
main.ts 0 100 100 0 1-13
src/api 0 100 0 0
toast.d.ts 0 0 0 0
src/utils 100 100 100 100
sleep.ts 100 100 100 100
src/utils/request 0 100 100 0
index.ts 0 100 100 0 1-6
------------------------------- --------- ---------- --------- --------- -------------------
Test Suites: 1 passed, 1 total
Tests: 2 passed, 2 total
Snapshots: 0 total
Time: 8.779 s
Ran all test suites.
Done in 9.76s.

Additional context

“test:coverage”: “jest --coverage --maxWorkers 2”

not work

Environment

System:
    OS: Windows 10 10.0.22000
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-11320H @ 3.20GHz
  Binaries:
    Node: 16.14.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.3.1 - C:\Program Files\nodejs\npm.CMD
  npmPackages:
    jest: ^28.1.2 => 28.1.2

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:12

github_iconTop GitHub Comments

3reactions
KyDenZcommented, Aug 24, 2022

With Jest 27 I didn’t have the problem, when I switched to Jest 28 I had the same error.

I had problems importing in the files where I had this error.

I don’t know why it was not a problem with the build and with version 27.

Now it works

2reactions
dr-azbestcommented, Sep 20, 2022

I had exact same error message on CI tests. It affected all my test cases. This message hides real problem. You have to change maxWorkers to 1 to see what is the problem on single thread. Then you will see cause of error which helps you to resolve issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jest worker encountered 4 child process exceptions ...
Here is the error: Test suite failed to run Jest worker encountered 4 child process exceptions, exceeding retry limit at ...
Read more >
Jest worker encountered 4 child process ... - DevPress
Here is the error: Test suite failed to run Jest worker encountered 4 child process exceptions, exceeding retry limit at ...
Read more >
Jest worker encountered 4 child process exceptions ...
Coding example for the question Jest worker encountered 4 child process exceptions, exceeding retry limit-Vue.js.
Read more >
how do I test in react testing library if a button succesfully ...
Test suite failed to run. Jest worker encountered 4 child process exceptions, exceeding retry limit. at ChildProcessWorker.initialize ...
Read more >
jest-worker - npm
Module for executing heavy tasks under forked processes in parallel, by providing a `Promise` based interface, minimum overhead, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found