You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Jest failing with "Call retries were exceeded", using --runInBand works-around issue #8769
I've got 2 test files. In the test, a WebAssembly object gets instantiated. This instantiation seems to stall for some reason when running the test in CI. Locally running jest passes the tests fine.
In CI they fail with this error:
● Test suite failed to run
Call retries were exceeded
at ChildProcessWorker.initialize (../node_modules/jest-worker/build/workers/ChildProcessWorker.js:193:21)
When -i is used however, they pass as well in CI.
Jest: 24.8.0
Node: 10.15.0
Local env: macOS, 10.14.6 (18G84))
CI env: CircleCI, Docker Linux 6a7bd3b63625 4.15.0-1035-aws #37-Ubuntu SMP Mon Mar 18 16:15:14 UTC 2019 x86_64 GNU/Linux
To Reproduce
I don't have a concise repro repo at this moment.
Expected behavior
I expect the tests to pass as well when not run in band.
@Antony2025 same here. After upgrading to node v13.2.0 my test suite which has many async test statements started to fail. Funny thing is that if I delete a few async tests from the test suite it works again.
I just faced the same issue in CI and was able to reproduce it in local by switching to the latest version of node. As suggested, only by downgrading fixes it for me, using -i didn't.
I have observed the same issue on Node 13.2.0 (where updating node is the only change since it was previously working reliably; package-lock.json has not changed, and I have tried before and after clearing out and rebuilding node_modules).
For me, running with --runInBand results in 8266 Segmentation fault: 11 at the same point where it otherwise fails with Call retries were exceeded at ChildProcessWorker.initialize. I am running on macOS 10.14.6 and installed node via Homebrew. After the crash it notes that it reached 33 passing test suites with 106 total tests. The codebase contains 34 test suites and 122 total tests (I don't know if these numbers are similar for other people hitting the issue?). I have many async tests in the rest of the code but the suite which hits this error contains only synchronous tests.
Since it's segfaulting, I suspect this is a bug in Node itself (seemingly a regression since this was an issue before), but I have no idea where to begin looking!
Is it possible that this could be connected to nodejs/node#26628 ? (seems to be the only entry in the Node 13.2.0 changelog which relates to workers)
If we run with node 16, it does not complain at all. Node 14 yells Call retries were exceeded without any implicit error message and it's very difficult to spot the bug.
Do not know why but this worked like charm.
In my case, I was not awaiting a findByText. Switching to getByText fixed the issue for me.
Essentially you need to ensure that any custom async functions being called from your tests need to implement a try/catch.
It makes sense that a try/catch block solves the issue because it's a way of catching rejections. Essentially all Promises in tests should catch or handle reject.
For me, my problem was with not mocking a dependency exhaustively when some components in the dependency were being used in the component I was testing. For instance
// note B is not mocked, it will be undefinedjest.mock("dependency",()=>({A: (props)=>Something}))// condition as false will require B to be definedit("shows something",()=>{<MyComponentcondition={false}/>})
This would throw this error until I fully mocked the dependency like this (to ensure B is not undefined in the mock):
// note B will now be defined as the unmocked versionjest.mock("dependency",()=>({
...jest.requireActual("dependency"),A: (props)=>Something}))
While my component also had some async work, that was never the problem.
Try to check if you have some things that are undefined possibly due to mocking.
I was trying to run the craco tests and I got the error:
Test suite failed to run
Call retries were exceeded
at ChildProcessWorker.initialize (node_modules/jest-worker/build/workers/ChildProcessWorker.js:193:21)
I added the option for Node.js for craco test command:
NODE_OPTIONS=--unhandled-rejections=warn craco test
In my case, it was caused by some unit tests where I forgot to return the promise. Once I added the return keyword it showed me the real reason of the failure (which is specific to my code).
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.
This issue 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.
Activity
lh0x00 commentedon Aug 1, 2019
do you use
jest-worker? Please provide more information about your use of it if available. or say more about the file that runs your test.martijnthe commentedon Aug 1, 2019
Not that I’m aware of? I do see it as a dependency in my yarn.lock file.
But I didn’t add any configuration in the jest.config.js for it.
I will try to create a minimal repro example when I find some time.
lh0x00 commentedon Aug 1, 2019
Ok, do you provide a reproduce code?
martijnthe commentedon Aug 1, 2019
fernandoabolafio commentedon Nov 26, 2019
Any lucky on this? I am having the same issue after upgrading to node v13.
creativecomposer commentedon Nov 27, 2019
I observed that the issue occurs with node v13.2.0, but not with v13.1.0. Looks like the issue with only the latest node version.
fernandoabolafio commentedon Nov 27, 2019
@Antony2025 same here. After upgrading to node v13.2.0 my test suite which has many async test statements started to fail. Funny thing is that if I delete a few async tests from the test suite it works again.
degouville commentedon Nov 27, 2019
Same for me I have the same issue w/ Node 10.17.0
nelsieborja commentedon Nov 29, 2019
I just faced the same issue in CI and was able to reproduce it in local by switching to the latest version of node. As suggested, only by downgrading fixes it for me, using
-ididn't.davidje13 commentedon Nov 30, 2019
I have observed the same issue on Node 13.2.0 (where updating node is the only change since it was previously working reliably; package-lock.json has not changed, and I have tried before and after clearing out and rebuilding node_modules).
For me, running with
--runInBandresults in8266 Segmentation fault: 11at the same point where it otherwise fails withCall retries were exceeded at ChildProcessWorker.initialize. I am running on macOS 10.14.6 and installed node via Homebrew. After the crash it notes that it reached 33 passing test suites with 106 total tests. The codebase contains 34 test suites and 122 total tests (I don't know if these numbers are similar for other people hitting the issue?). I have manyasynctests in the rest of the code but the suite which hits this error contains only synchronous tests.Since it's segfaulting, I suspect this is a bug in Node itself (seemingly a regression since this was an issue before), but I have no idea where to begin looking!
Is it possible that this could be connected to nodejs/node#26628 ? (seems to be the only entry in the Node 13.2.0 changelog which relates to workers)
davidje13 commentedon Nov 30, 2019
Appears this issue has been reported upstream: nodejs/node#30730
rafaelcamargo commentedon Dec 1, 2019
Hey guys! I was having this issue on CI only (CircleCI). So I changed the following value on CI config file and the issue has gone:
Before
Then
79 remaining items
dicutaia commentedon Apr 20, 2022
In my case, I was not awaiting a
findByText. Switching togetByTextfixed the issue for me.nlasso-longevo commentedon Jul 1, 2022
Hi, for me this error was related to M1 processor. Run tests on a terminal with rosetta enabled and got it working.
mohammedabdulai commentedon Aug 26, 2022
It makes sense that a try/catch block solves the issue because it's a way of catching rejections. Essentially all Promises in tests should catch or handle reject.
Temirtator commentedon Feb 8, 2023
mostly, If you met such type of problem you need to take an attention to asynchrous test, perhaps problem related with this
johnmutuma5 commentedon Mar 10, 2023
For me, my problem was with not mocking a dependency exhaustively when some components in the dependency were being used in the component I was testing. For instance
in my test
This would throw this error until I fully mocked the dependency like this (to ensure B is not
undefinedin the mock):While my component also had some async work, that was never the problem.
Try to check if you have some things that are undefined possibly due to mocking.
lazy-b commentedon Apr 24, 2023
全体起立!
在
setupTests.js或者出现问题的单元测试文件添加下面的代码,完美解决!!!kostyaostapuk commentedon Oct 3, 2023
I was trying to run the craco tests and I got the error:
I added the option for Node.js for
craco testcommand:NODE_OPTIONS=--unhandled-rejections=warn craco testMy package.json:
"scripts": {"test": "NODE_OPTIONS=--unhandled-rejections=warn craco test"}marcostomasello commentedon Apr 26, 2024
In my case, it was caused by some unit tests where I forgot to return the promise. Once I added the
returnkeyword it showed me the real reason of the failure (which is specific to my code).Bharatfegade commentedon Feb 24, 2025
Call retries were exceeded at ChildProcessWorker.initialize (node_modules/jest-worker/build/workers/ChildProcessWorker.js:193:21)
I am getting above issue. Below is the fix i found for this.
Fix:-
Change Node Version to v14.21.3
Change SonarQube Version to 9.9.8.100196
github-actions commentedon Feb 24, 2026
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days.
github-actions commentedon Mar 26, 2026
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.
github-actions commentedon Apr 26, 2026
This issue 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.