From: Zorro Lang <zlang@kernel.org>
To: fstests@vger.kernel.org
Cc: Theodore Ts'o <tytso@mit.edu>, linux-ext4@vger.kernel.org
Subject: [RFC PATCH 0/4] check: add --loop* family options for repeating tests
Date: Wed, 11 Nov 2026 01:09:16 +0800 [thread overview]
Message-ID: <20261110170920.3302511-1-zlang@kernel.org> (raw)
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/20260415213248.1795275-1-tytso@mit.edu/
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/20260826102857.3224318-1-zlang@kernel.org/
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(-)
--
2.56.0
next reply other threads:[~2026-11-10 17:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 17:09 Zorro Lang [this message]
2026-11-10 17:09 ` [RFC PATCH 1/4] check: add long aliases --iterate and --iterate-while-successful Zorro Lang
2026-11-10 17:09 ` [RFC PATCH 2/4] check: add --loop option to run each test multiple times Zorro Lang
2026-11-10 17:09 ` [RFC PATCH 3/4] check: add --loop-on-fail long name for -L Zorro Lang
2026-11-10 17:09 ` [RFC PATCH 4/4] check: add --loop-while-successful option Zorro Lang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261110170920.3302511-1-zlang@kernel.org \
--to=zlang@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox