Skip to content

Commit 6230edd

Browse files
committed
fix: handle ERR_IPC_CHANNEL_CLOSED errors properly (#11143)
1 parent 417650e commit 6230edd

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
- `[jest-transform]` [**BREAKING**] Refactor API of transformers to pass an options bag rather than separate `config` and other options ([#10834](https://github.com/facebook/jest/pull/10834))
5858
- `[jest-worker]` [**BREAKING**] Use named exports ([#10623](https://github.com/facebook/jest/pull/10623))
5959
- `[jest-worker]` Do not swallow errors during serialization ([#10984](https://github.com/facebook/jest/pull/10984))
60+
- `[jest-worker]` Handle `ERR_IPC_CHANNEL_CLOSED` errors properly ([#11143](https://github.com/facebook/jest/pull/11143))
6061
- `[pretty-format]` [**BREAKING**] Convert to ES Modules ([#10515](https://github.com/facebook/jest/pull/10515))
6162
- `[pretty-format]` Only call `hasAttribute` if it's a function ([#11000](https://github.com/facebook/jest/pull/11000))
6263

packages/jest-worker/src/workers/ChildProcessWorker.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,10 @@ export default class ChildProcessWorker implements WorkerInterface {
202202
}
203203
}
204204

205-
private _onExit(exitCode: number) {
205+
private _onExit(exitCode: number | null) {
206206
if (
207207
exitCode !== 0 &&
208+
exitCode !== null &&
208209
exitCode !== SIGTERM_EXIT_CODE &&
209210
exitCode !== SIGKILL_EXIT_CODE
210211
) {
@@ -236,7 +237,7 @@ export default class ChildProcessWorker implements WorkerInterface {
236237

237238
this._request = request;
238239
this._retries = 0;
239-
this._child.send(request);
240+
this._child.send(request, () => {});
240241
}
241242

242243
waitForExit(): Promise<void> {

0 commit comments

Comments
 (0)