Repository navigation
fix: stop 8 bash test suites leaking temp directories - #381
Merged
Merged
Conversation
make_tmpdir ran inside a command substitution, so its CLEANUP_DIRS registration never reached the EXIT trap. Each suite now creates one unique run root in the parent shell and the existing trap removes it. Adds tests/test_tmpdir_cleanup.sh (red first: 8 of 8 suites leaked 114 dirs; green after the fix). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Data-Wise
added a commit
that referenced
this pull request
Nov 1, 2026
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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
Eight bash test suites no longer leak temp directories. Each defined
make_tmpdirand called it asdir=$(make_tmpdir); that runs in a subshell, so itsCLEANUP_DIRS+=never reached the parent shell and theEXITtrap removed nothing. Each suite now creates one unique run root in the parent shell (registered for the existing trap) andmake_tmpdirmakes its directories inside it. A unique root avoids a prefix glob that could delete another run's directories.Suites:
test_branch_guard,test_branch_guard_e2e,test_git_dryrun,test_git_utils,test_insights_improvements_e2e,test_marketplace_e2e,test_no_switch_guard,test_release_skill_e2e. New guard:tests/test_tmpdir_cleanup.shruns each suite with an isolatedTMPDIRand asserts it is empty afterward.Evidence
Red first (all 8 suites leaked, 114 dirs in the isolated TMPDIR):
After the fix (also re-run after merging
origin/devv4.8.2):Results: 8 passed, 0 failed.No behavior change in the suites: exit codes match the baseline (
test_branch_guard,test_branch_guard_e2e,test_git_dryrun,test_git_utils,test_no_switch_guardexit 0;test_insights_improvements_e2e,test_marketplace_e2e,test_release_skill_e2eexit 1 as ondev, tracked in #377). Nothing leaked into the real$TMPDIR. markdownlint on both changelogs: 0 issues.Notes
origin/devto clear CHANGELOG conflicts; squash-merge drops it.🤖 Generated with Claude Code