Repository navigation
test: keep the interrupt test's own Ctrl-C inside its try - #522
Merged
Merged
Conversation
The timer was started before the try, and its cancel and join ran in a finally, so a signal raised while the main thread waited in start() or in the cleanup left the test and stopped the whole pytest run (seen once on main, linux/amd64, Python 3.13, run 45959878115). Both loops (in process and in the child process) now catch it wherever it is raised from start() on. Closes #512
This was referenced Nov 27, 2026
Merged
Open
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
The interrupt test started its signal timer before the
tryand cleaned up in afinally, so a signal raised outside the statement could leave the test and stop the whole pytest run. Both loops (in process and in the child process) now start, run, and clean up inside onetrythat catchesKeyboardInterrupt. Only the test changes.Related issues
Closes #512
Performance changes
None.
Docs
None needed.
Checklist
uvx pre-commit run --files <changed files>passes