Skip to content

feat(cli): --repeat to run each test n times - #1041

Merged
Chemaclass merged 1 commit into
mainfrom
feat/1013-repeat
Aug 10, 2026
Merged

feat(cli): --repeat to run each test n times#1041
Chemaclass merged 1 commit into
mainfrom
feat/1013-repeat

Conversation

@Chemaclass

Copy link
Copy Markdown
Member

🤔 Background

Related #1013

--retry mitigates flakiness only after it has already burned a CI run. There was no way to go looking for it: proving a test deterministic meant running the suite N times by hand and diffing the output.

💡 Changes

  • --repeat <n> runs each selected test n times, so --repeat 50 --filter flaky_candidate is the natural "hammer this one test" invocation.
  • The test is reported once with the aggregate outcome, counted once, and its assertion counts are not multiplied. A failure names the iteration it happened on.
  • Repeat is the outer loop and --retry the inner one: each iteration gets its full retry budget before the next starts. Documented and covered by a test.
  • --repeat 0, negative and non-numeric values exit non-zero with a usage error rather than becoming silent no-ops.

--retry mitigates flakiness after it has already burned a CI run. There
was no way to go looking for it: proving a test deterministic meant
running the suite N times by hand and diffing the output.

--repeat wraps the existing retry loop rather than replacing it, so
repeat is the outer loop and retry the inner one: each iteration gets its
full retry budget before the next iteration starts. The test is reported
once with the aggregate outcome, so the counters and every report see one
entry, and the assertion counts are the deciding iteration's rather than
the sum of all of them.

Iterating stops at the first failing iteration, since the test is already
going to be reported failed. The failure message names the iteration,
which is the only way the count is actionable when the test appears once.

0, a negative value and a non-numeric value are usage errors rather than
silent no-ops: 0 passes the non-negative check the other integer settings
use, so it needs its own guard (#873 class of bug).

Closes #1013
@Chemaclass Chemaclass added the enhancement New feature or request label Aug 10, 2026
@Chemaclass Chemaclass self-assigned this Aug 10, 2026
@Chemaclass
Chemaclass merged commit 9baf1b5 into main Aug 10, 2026
37 checks passed
@Chemaclass
Chemaclass deleted the feat/1013-repeat branch August 10, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant