-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
modified SIGINT handling #3570 #3602
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fires the signal recursively?
It doesn't work for me, FWIW...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you read the GNU signal handling link I posted, reraising the signal is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@boneskull
@plroebuck - Updated to reraise the signal once as specified in the comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plroebuck That's fine, but nowhere does it say you're supposed to trigger your custom handler again. Which is what's happening if you debug this. ... at least on my machine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Jayasankar-m has addressed this in 956dc59, but I have a suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My wi-fi has been really spotty of late, with comments made but never posted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alright, I apologize, this is coming back to me now.
The intent here is to cleanly exit, which it seems we just ditched with the PR.
We call
runner.abort()
, which simply sets a flag in the runner. Once the current test completes, the runner encounters this flag, and exits the process with an exit code reflecting the number of test failures.This, of course, conflicts with the intent of this PR, which was to not let the currently-running test complete, and just exit.
I made this change so long ago, I'm not sure about the reasoning behind the "hack"; pretty sure that was me. Nor am I sure of the reasons behind the intent of a clean exit, but that's the intent nonetheless.It's likely we've broken the "exit code with # of failures" feature here (which I realize you do not like), but only if we interrupt the process.
This seems OK to me, not recalling the original reasons for doing this, but also means the handler itself is useless and should be removed.
UPDATE: I didn't make this change, which is probably why I don't remember doing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, it comes from #2438 by @Munter.
We're exiting with
130
to ensure the expected behavior--exiting with code130
--is retained while the handler disrupts the default behavior.But because we're now actually invoking the default behavior, we don't need to call
runner.abort()
(because the process will immediately exit), and we don't need to setrunner.failures
(because the process will immediately exit) and we don't need to setprocess.exitCode
if we just remove the damnSIGINT
handler.I'll send a PR to this effect.