Skip to content

Commit

Permalink
signal exit code constants
Browse files Browse the repository at this point in the history
  • Loading branch information
jeysal committed Apr 4, 2019
1 parent 3dd49d3 commit 3f56b4b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/jest-worker/src/workers/ChildProcessWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ import {
ParentMessage,
} from '../types';

const SIGNAL_BASE_EXIT_CODE = 128;
const SIGKILL_EXIT_CODE = SIGNAL_BASE_EXIT_CODE + 9;
const SIGTERM_EXIT_CODE = SIGNAL_BASE_EXIT_CODE + 15;

// How long to wait after SIGTERM before sending SIGKILL
const SIGKILL_DELAY = 500;

Expand Down Expand Up @@ -198,8 +202,8 @@ export default class ChildProcessWorker implements WorkerInterface {
private _onExit(exitCode: number) {
if (
exitCode !== 0 &&
exitCode !== 137 && // SIGKILL
exitCode !== 143 // SIGTERM
exitCode !== SIGTERM_EXIT_CODE &&
exitCode !== SIGKILL_EXIT_CODE
) {
this.initialize();

Expand Down

0 comments on commit 3f56b4b

Please sign in to comment.