feat: ensure teardown always runs (even when setup fails or on SIGINT/SIGTERM)#7
Merged
andreasjansson merged 59 commits intomainfrom Feb 2, 2026
Merged
feat: ensure teardown always runs (even when setup fails or on SIGINT/SIGTERM)#7andreasjansson merged 59 commits intomainfrom
andreasjansson merged 59 commits intomainfrom
Conversation
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.
Summary
This PR ensures that
_teardown.txtalways runs, regardless of:Changes
Core Changes
runner.rs: Refactoredrun_suiteto not return early on setup failure - instead it skips main tests but continues to teardownrunner.rs: Addedignore_interruptionparameter torun_corpus_fileso teardown can run even when the interrupted flag is setmain.rs: Added signal handler usingctrlccrate (withterminationfeature) to catch SIGINT, SIGTERM, and SIGHUPrunner.rs: AddedINTERRUPTEDatomic flag and checks between tests to enable graceful shutdownNew Tests
test/teardown_always/- comprehensive tests for teardown-always-runs behavior/tmpmarker files%TEMP%marker filesDocumentation
Limitations
bash -cor as a background process, signal handling may not work reliably. Works correctly when cctr runs directly.Testing
All existing tests pass plus 6 new Unix tests and 5 new Windows tests (platform-skipped appropriately).