Skip to content

Commit

Permalink
fix: handle ERR_IPC_CHANNEL_CLOSED errors properly (jestjs#11143)
Browse files Browse the repository at this point in the history
  • Loading branch information
xamgore committed Mar 7, 2021
1 parent 417650e commit 6230edd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -57,6 +57,7 @@
- `[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))
- `[jest-worker]` [**BREAKING**] Use named exports ([#10623](https://github.com/facebook/jest/pull/10623))
- `[jest-worker]` Do not swallow errors during serialization ([#10984](https://github.com/facebook/jest/pull/10984))
- `[jest-worker]` Handle `ERR_IPC_CHANNEL_CLOSED` errors properly ([#11143](https://github.com/facebook/jest/pull/11143))
- `[pretty-format]` [**BREAKING**] Convert to ES Modules ([#10515](https://github.com/facebook/jest/pull/10515))
- `[pretty-format]` Only call `hasAttribute` if it's a function ([#11000](https://github.com/facebook/jest/pull/11000))

Expand Down
5 changes: 3 additions & 2 deletions packages/jest-worker/src/workers/ChildProcessWorker.ts
Expand Up @@ -202,9 +202,10 @@ export default class ChildProcessWorker implements WorkerInterface {
}
}

private _onExit(exitCode: number) {
private _onExit(exitCode: number | null) {
if (
exitCode !== 0 &&
exitCode !== null &&
exitCode !== SIGTERM_EXIT_CODE &&
exitCode !== SIGKILL_EXIT_CODE
) {
Expand Down Expand Up @@ -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<void> {
Expand Down

0 comments on commit 6230edd

Please sign in to comment.