Skip to content

fix(test): make _supports_wait_n test set -e safe#691

Merged
Chemaclass merged 1 commit into
mainfrom
fix/parallel-test-strict-cascade
Jun 3, 2026
Merged

fix(test): make _supports_wait_n test set -e safe#691
Chemaclass merged 1 commit into
mainfrom
fix/parallel-test-strict-cascade

Conversation

@Chemaclass
Copy link
Copy Markdown
Member

🤔 Background

Running ./bashunit -s -p --strict on Bash 3.x reported a failure: 21 of 23 tests in parallel_test.sh errored.

💡 Changes

  • test_supports_wait_n_matches_running_bash_version called bashunit::runner::_supports_wait_n as a bare statement; on Bash < 4.3 it returns 1, so under set -euo pipefail the test body aborted and cascaded into the rest of the file
  • Capture the return code with || actual_rc=$? so --strict no longer aborts
  • Only surfaced on Bash 3.x; CI runs the strict job on Bash 5 where the function returns 0

On Bash < 4.3 bashunit::runner::_supports_wait_n returns 1; called as a
bare statement under --strict (set -euo pipefail) it aborted the test
body, which cascaded into the rest of parallel_test.sh erroring. Capture
the rc with '|| actual_rc=$?' instead. Only surfaced on Bash 3.x, which
CI never exercises under --strict.
@Chemaclass Chemaclass added the bug Something isn't working label Jun 3, 2026
@Chemaclass Chemaclass self-assigned this Jun 3, 2026
@Chemaclass Chemaclass merged commit 777ed37 into main Jun 3, 2026
30 checks passed
@Chemaclass Chemaclass deleted the fix/parallel-test-strict-cascade branch June 3, 2026 09:46
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.

1 participant