feat(cli): add --retry <n> to re-run failed tests#756
Merged
Conversation
Re-run a failed test up to N extra times (--retry <n> / BASHUNIT_RETRY), reporting it passed if any attempt passes. Retry wraps only test execution; the parse/report/counter path runs once on the final attempt, so nothing is double-counted and each --parallel fork retries itself. Tests that only pass on retry are annotated '(retry n/m)'. Disabled by default. Closes #737
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 #737
Flaky tests (timing, network, filesystem races) fail intermittently and poison CI. A bounded retry lets a genuinely-flaky test recover while a consistently-broken one still fails, without hiding real failures.
💡 Changes
--retry <n>flag andBASHUNIT_RETRYenv var; a failed test is re-run up to N extra times and reported passed if any attempt passes. Disabled by default (0).--parallelfork retries itself.(retry n/m)so flakiness stays visible; composes with--stop-on-failure.