Search code examples
linuxjestjs

A jest worker process was terminated by another process


I am getting following error when I am building my application.

Test suite failed to run

  A jest worker process (pid=2439) was terminated by another process: signal=SIGKILL, exitCode=null. Operating system logs may contain more information on why this occurred.
    at ChildProcessWorker._onExit (node_modules/jest-worker/build/workers/ChildProcessWorker.js:366:23)

Can you please advice how to check OS logs on linux system and how to resolve this issue?


Solution

  • A temporary workaround is running jest with these two arguments, --runInBand --no-cache, to run all tests in serial (slower) and to use a clean cache every time (also slower). But at least the tests run. 😬

    FYI, I'm using NODE_OPTIONS=--experimental-vm-modules to use ESM modules with ts-jest. Not sure if that causes the instability.