Skip to content

fix(runner): run teardown after setup failure - #1319

Merged
Chemaclass merged 1 commit into
mainfrom
fix/teardown-after-setup-failure
Aug 19, 2026
Merged

fix(runner): run teardown after setup failure#1319
Chemaclass merged 1 commit into
mainfrom
fix/teardown-after-setup-failure

Conversation

@Chemaclass

Copy link
Copy Markdown
Member

Background

Closes #1318

A failing set_up_before_script skips all tests but previously also skipped tear_down_after_script. Resources acquired before a later setup command failed were left behind.

Changes

  • Run tear_down_after_script before clearing file hooks and script-scoped temporary state when setup fails
  • Apply the same lifecycle to benchmark files
  • Cover cleanup with an actual resource marker in sequential, parallel, and benchmark runs
  • Document partial initialization and defensive teardown

Verification

  • ./bashunit -s -p --skip-env-file tests/acceptance/bashunit_setup_before_script_error_test.sh tests/acceptance/bashunit_bench_test.sh (12 tests, 46 assertions)
  • make sa
  • make lint
  • make docs/build
  • git diff --check

Checklist

  • I updated the CHANGELOG.md to reflect the fix
  • I updated the documentation to reflect the changes

File-scoped setup can acquire resources before a later command fails. Always invoke its paired teardown before clearing hook and temporary state.

Closes #1318
@Chemaclass Chemaclass self-assigned this Aug 19, 2026
@Chemaclass Chemaclass added the bug Something isn't working label Aug 19, 2026
@Chemaclass
Chemaclass merged commit e147067 into main Aug 19, 2026
37 checks passed
@Chemaclass
Chemaclass deleted the fix/teardown-after-setup-failure branch August 19, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tear_down_after_script is not run when set_up_before_script fails

2 participants