-
-
Notifications
You must be signed in to change notification settings - Fork 34.9k
Open
Description
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
node/lib/internal/test_runner/harness.js
Lines 313 to 322 in c9d0ef8
| 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels