Skip to content

test_runner: fix wrong signal exit codes#62039

Open
edilson258 wants to merge 2 commits intonodejs:mainfrom
edilson258:fix/test-runner-signal-exit-codes
Open

test_runner: fix wrong signal exit codes#62039
edilson258 wants to merge 2 commits intonodejs:mainfrom
edilson258:fix/test-runner-signal-exit-codes

Conversation

@edilson258
Copy link

The test runner was exiting with a generic error code when interrupted by signals such as SIGINT, instead of using the standard signal-based exit codes.

This change ensures the runner returns the correct signal exit code (e.g., 130 for SIGINT) rather than 1.

Fixes: #62037

The test runner was exiting with a generic error code when interrupted
by signals such as SIGINT, instead of using the standard signal-based
exit codes.

This change ensures the runner returns the correct signal exit code
(e.g., 130 for SIGINT) rather than 1.

Fixes: nodejs#62037
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Feb 28, 2026
Comment on lines +288 to +289
process.removeListener('SIGINT', () => terminationHandler(kSigInt));
process.removeListener('SIGTERM', () => terminationHandler(kSigTerm));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wouldn't work as it is a different function than the the attached listener?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed and i think we can fix by creating a handler for each signal and use the same on signal attach and removal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_runner: use default signal exit codes when interrupted

3 participants