fix(runner): run tear_down for a test killed by the timeout - #1333
Merged
Conversation
The watchdog kills a timed-out test with a group SIGTERM, and bash runs no EXIT trap for a fatal signal it has no trap for. cleanup_on_exit never fired, so tear_down was skipped and whatever set_up acquired for that test was leaked. The file-scoped hook already survived, because the runner loop carries on to the next file, which left the two halves of the pair behaving differently for one kill. Trap TERM in the test-body subshell and exit 143, handing control to the EXIT trap where tear_down already lives. Best effort by design: the watchdog SIGKILLs the group 0.3s later, so a tear_down slower than that grace is cut off. A hook that never returns must not outlive the timeout it is cleaning up after. The grace is left as it was; measured against the full parallel suite running as load, the acceptance test passed 10 times out of 10. Closes #1324
JesusValeraDev
approved these changes
Aug 20, 2026
6 tasks
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.
🤔 Background
Related #1324
The watchdog kills a timed-out test with a group SIGTERM, and bash runs no EXIT trap for a fatal signal it has no trap for.
cleanup_on_exitnever fired, sotear_downwas skipped and whateverset_upacquired for that test was leaked. The file-scoped hook already survived, because the runner loop carries on to the next file, so the two halves of the pair behaved differently for one kill.💡 Changes
tear_downalready lives.tear_downslower than that grace is cut off: a hook that never returns must not outlive the timeout it is cleaning up after.--no-paralleland--parallelnow run the per-test hook on a timeout.