When the Node.js test runner is interrupted (e.g., via SIGINT or SIGTERM), it currently exits with default (0) exit code instead of the standard signal-based exit codes.
Line: 321
|
const terminationHandler = async () => { |
|
const runningTests = findRunningTests(root); |
|
if (runningTests.length > 0) { |
|
root.reporter.interrupted(runningTests); |
|
// Allow the reporter stream to process the interrupted event |
|
await new Promise((resolve) => setImmediate(resolve)); |
|
} |
|
await exitHandler(true); |
|
process.exit(); |
|
}; |
Because of this, parent processes (like CI pipelines, shell scripts, or task runners) cannot distinguish between a successful process exit and an intentional user interruption.
When the Node.js test runner is interrupted (e.g., via SIGINT or SIGTERM), it currently exits with default (0) exit code instead of the standard signal-based exit codes.
Line:
321node/lib/internal/test_runner/harness.js
Lines 313 to 322 in c9d0ef8
Because of this, parent processes (like CI pipelines, shell scripts, or task runners) cannot distinguish between a successful process exit and an intentional user interruption.