From b2597243992dbfd718eb94a658fd02095606f6c3 Mon Sep 17 00:00:00 2001 From: Igor Strebezhev Date: Wed, 3 Mar 2021 03:52:08 +0300 Subject: [PATCH] Fix unhandled ERR_IPC_CHANNEL_CLOSED and a deadlock The detailed description is at https://github.com/facebook/jest/issues/11143. --- packages/jest-worker/src/workers/ChildProcessWorker.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/jest-worker/src/workers/ChildProcessWorker.ts b/packages/jest-worker/src/workers/ChildProcessWorker.ts index 6b7daa4758f2..8c3e13bccd38 100644 --- a/packages/jest-worker/src/workers/ChildProcessWorker.ts +++ b/packages/jest-worker/src/workers/ChildProcessWorker.ts @@ -205,6 +205,7 @@ export default class ChildProcessWorker implements WorkerInterface { private _onExit(exitCode: number) { if ( exitCode !== 0 && + exitCode !== null && exitCode !== SIGTERM_EXIT_CODE && exitCode !== SIGKILL_EXIT_CODE ) { @@ -236,7 +237,7 @@ export default class ChildProcessWorker implements WorkerInterface { this._request = request; this._retries = 0; - this._child.send(request); + this._child.send(request, () => {}); } waitForExit(): Promise {