Skip to content

Instantly share code, notes, and snippets.

@vilmosioo
Created August 26, 2022 16:29
Show Gist options
  • Save vilmosioo/ca1643d231d03bdaae8e7b49fc484e13 to your computer and use it in GitHub Desktop.
Save vilmosioo/ca1643d231d03bdaae8e7b49fc484e13 to your computer and use it in GitHub Desktop.
1. Run jest with worker count higher than 1. Empty test that just sleeps for a minute will do.
2. Kill one of the workers intentionally. In practice, they may die for whatever reason, for us we suspect it is OOM.
3. Jest will indefinitely hang.
Related and recent fix https://github.com/facebook/jest/pull/13054/files#diff-e99351d361fdd6f55d39c7c41af94576baccc2b9dce73a5bfd0b516c6ab648e9
However the workers may crash with other signals and those scenarios are not covered. In our case, after some debugging, the signal is null. For some reason these workers are crashing in jest-runtime at the compileFunction.call line, and causes a null exit code, which gets ignored. jest-runner waits on a thread pool that'll never fulfil the submitted job.
The signal appears to be SIGKILL instead of SIBABRT , and the exitCode appears to be null. Please see screenshots of the debug process.
<img width="815" alt="Screenshot 2022-08-26 at 17 25 32" src="https://user-images.githubusercontent.com/1485154/186950108-971329f6-3fbd-4620-805b-98ed40f480ab.png">
There's a log saying [random].test.ts started running in the worker, but not that it finished.
We apologize for the lack of a minimal reproduction, but hope the thorough investigation given will substitute.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment