Skip to content

RFC check: add --loop* family options for repeating tests

Zorro Lang fstests linux-ext4 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4check: add long aliases --iterate and --iterate-while-successfulcheck+6 -50 replies
2/4check: add --loop option to run each test multiple timescheck+95 -270 replies
3/4check: add --loop-on-fail long name for -Lcheck+4 -40 replies
4/4check: add --loop-while-successful optioncheck+25 -70 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/4] check: add --loop* family options for repeating tests

This series originates from Ted Ts'o's RFC:

[PATCH RFC] check: add new option "--loop <n>" which runs each test multiple times
https://lore.kernel.org/fstests/[email protected]/

At the time, we didn't reach a consensus, and because the argument parsing in ./check was quite messy, I decided to refactor it before introducing more options. That refactoring is now complete:

https://lore.kernel.org/fstests/[email protected]/

so I think it's time to revisit this RFC and the follow-up changes.

--loop re-runs each test unconditionally, fixing two problems of "-i <n>": per-run artifacts (e.g. NNN.out.bad) were not preserved, and
result.xml was rewritten for every test set, losing cumulative junit statistics. That RFC predates the check argument-parsing rewrite to getopt, so patch 2 was rewritten on top of it, generalizing the -L rerun state machine to support multiple loop modes.

Per-test looping options (mutually exclusive; repeating the same mode overrides its count):

--loop <n> run each test <n> times. Artifacts of every
run are stashed with .rerunN suffixes, the junit report gets one testcase per run, an aggregate pass/fail line is printed, and the test fails if any of its runs fails.
-L, --loop-on-fail <n> rerun a test <n> times after its first
failure (<n>+1 runs in total). Existing -L behaviour, now with a long name.
--loop-while-successful <n>
run each test up to <n> times, stopping at the first failure; handy for bisecting flaky tests.

Whole-list iteration gets long names as well:

-i, --iterate <n> iterate the entire test list <n> times
-I, --iterate-while-successful <n>
same, but stop after the first round that contains a failure

The short options -i, -I and -L keep their existing behaviour and remain available. Maybe we can remove them one day, or keep them.

One open question about the junit report: with --loop each run adds a testcase to result.xml, but the testsuite tests/failures attributes still count unique tests, consistent with the "Ran: ... / Failed ..." summary. Before this series the two were always equal, so report consumers that assume tests matches the number of testcase elements would see them diverge for the first time. We kept the current semantics for now; comments on whether the attributes should count per-run testcases instead (a follow-up common/report change) are welcome.

Thanks,
Zorro

Theodore Ts'o (1):
check: add --loop option to run each test multiple times

Zorro Lang (3):
check: add long aliases --iterate and --iterate-while-successful
check: add --loop-on-fail long name for -L
check: add --loop-while-successful option

 check | 153 +++++++++++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 120 insertions(+), 33 deletions(-)
Signature · 1 line
2.56.0