Skip to content

fix: clean up script temp files on source failure (#1325) - #1326

Merged
Chemaclass merged 3 commits into
TypedDevs:mainfrom
aditya226-sharma:fix/source-failure-temp-cleanup
Aug 21, 2026
Merged

fix: clean up script temp files on source failure (#1325)#1326
Chemaclass merged 3 commits into
TypedDevs:mainfrom
aditya226-sharma:fix/source-failure-temp-cleanup

Conversation

@aditya226-sharma

Copy link
Copy Markdown
Contributor

Summary

Adds the missing bashunit::cleanup_script_temp_files call on the source-failure path in the test discovery loop, matching what the bench loop already does.

Problem

When a test file fails to source under --no-parallel, the early continue at src/runner/discovery.sh:134-136 runs clean_set_up_and_tear_down_after_script and restore_workdir but skips cleanup_script_temp_files. Any bashunit::temp_file the file created at top level before the failure survives the run.

Fix

Added bashunit::cleanup_script_temp_files between clean_set_up_and_tear_down_after_script and restore_workdir on the source-failure path, matching the pattern already used in src/runner/bench.sh:51.

Verification

  • Source-failure reporting, exit code and message are unchanged.
  • --parallel is not affected (its end-of-run loop already sweeps every id).

Closes #1325

Two acceptance tests pin it: the sequential path, and --parallel --list, which
reaches no end-of-run sweep and is why this call is not behind the is_enabled
guard the other paths out of the loop use.
@Chemaclass
Chemaclass merged commit 3ad0704 into TypedDevs:main Aug 21, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A test file that fails to source leaks its script temp files

2 participants