[llvm] [lit] Add --rerun-failed-serially + --rerun-failed-matching (PR #223504)
Adrian Prantl via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 16 10:54:21 PDT 2026
https://github.com/adrian-prantl updated https://github.com/llvm/llvm-project/pull/223504
>From ebf4b1c1833596d2b44eec6bddb8d7ab2e7ecc38 Mon Sep 17 00:00:00 2001
From: Adrian Prantl <aprantl at apple.com>
Date: Mon, 14 Sep 2026 11:49:06 -0700
Subject: [PATCH 1/2] [lit] Add --rerun-failed-serially +
--rerun-failed-matching
CI systems sometimes run on hardware or operating system versions that
have known problems that need to be worked around. This change in
particular is motivated by an issue with certain versions of macOS
that very rarely (but often enough to be a problem at CI scale) drop a
burst of parallel debugserver's attach requests. The goal is to
recognize this very situation and the re-run the affected tests
without opnening the door for the entire testsuite to become less
reliable due to the retry mechanism.
Tests that pass the second time are reported as FLAKYPASS,
which keeps them out of the failure count and the exit status.
--max-retries-per-test composes with this: the rerun honors
allowed_retries as well, so each of its attempts is retried in place
as before.
--rerun-failed-matching restricts the rerun to failures whose output
matches a regular expression. Without it, any flaky test that happens
to pass on the rerun is laundered into a pass; with it, only the
failures a known platform bug produces get a second chance.
Assisted-by: Claude
---
llvm/docs/CommandGuide/lit.md | 19 ++++
llvm/utils/lit/lit/Test.py | 10 +++
llvm/utils/lit/lit/cl_arguments.py | 28 +++++-
llvm/utils/lit/lit/main.py | 36 +++++++-
.../rerun-failed-serially-retries/lit.cfg | 10 +++
.../needs-four-attempts.py | 22 +++++
.../rerun-failed-serially/always-fails.py | 3 +
.../rerun-failed-serially/fails-once.py | 17 ++++
.../Inputs/rerun-failed-serially/lit.cfg | 10 +++
llvm/utils/lit/tests/rerun-failed-serially.py | 89 +++++++++++++++++++
10 files changed, 240 insertions(+), 4 deletions(-)
create mode 100644 llvm/utils/lit/tests/Inputs/rerun-failed-serially-retries/lit.cfg
create mode 100644 llvm/utils/lit/tests/Inputs/rerun-failed-serially-retries/needs-four-attempts.py
create mode 100644 llvm/utils/lit/tests/Inputs/rerun-failed-serially/always-fails.py
create mode 100644 llvm/utils/lit/tests/Inputs/rerun-failed-serially/fails-once.py
create mode 100644 llvm/utils/lit/tests/Inputs/rerun-failed-serially/lit.cfg
create mode 100644 llvm/utils/lit/tests/rerun-failed-serially.py
diff --git a/llvm/docs/CommandGuide/lit.md b/llvm/docs/CommandGuide/lit.md
index f652110bfc2cb..ee5b2ee1bbd90 100644
--- a/llvm/docs/CommandGuide/lit.md
+++ b/llvm/docs/CommandGuide/lit.md
@@ -237,6 +237,25 @@ require a change in the test scripts or the test config:
Any option in the list above overrules its predecessor.
:::
+:::{option} --rerun-failed-serially
+Once all tests have run, run the tests that failed a second time, with a
+single worker regardless of {option}`-j`. Tests that pass the second time
+are reported as `FLAKYPASS`, so they do not count as failures and do not
+affect the exit status.
+
+{option}`--max-retries-per-test` retries a failed test immediately, in the
+same worker and alongside the tests that are still running; this option
+waits until nothing else is running. Both can be used at once, in which
+case each attempt of the rerun is retried as well.
+:::
+
+:::{option} --rerun-failed-matching REGEX
+Only rerun those failures whose output matches `REGEX`, to allow
+working around very specific known issues without allowing other
+tests to become unreliable due to the retry mechanism. Implies
+{option}`--rerun-failed-serially`.
+:::
+
:::{option} --allow-empty-runs
Do not fail the run if all tests are filtered out.
:::
diff --git a/llvm/utils/lit/lit/Test.py b/llvm/utils/lit/lit/Test.py
index 35da7afc591c0..f82fb51199150 100644
--- a/llvm/utils/lit/lit/Test.py
+++ b/llvm/utils/lit/lit/Test.py
@@ -313,6 +313,16 @@ def setResult(self, result):
result.code = XFAIL
self.result = result
+ def resetResult(self, result=None):
+ """Replace the result of this test and return the previous one.
+
+ Clearing the result is what allows a test to be run a second time,
+ and passing the previous result back in undoes that second run.
+ """
+ previous = self.result
+ self.result = result
+ return previous
+
def isFailure(self):
assert self.result
return self.result.code.isFailure
diff --git a/llvm/utils/lit/lit/cl_arguments.py b/llvm/utils/lit/lit/cl_arguments.py
index be0f154a10552..c8fba2bdc940a 100644
--- a/llvm/utils/lit/lit/cl_arguments.py
+++ b/llvm/utils/lit/lit/cl_arguments.py
@@ -366,6 +366,21 @@ def parse_args():
"ALLOWED_RETRIES keyword always take precedence)",
type=_positive_int,
)
+ execution_group.add_argument(
+ "--rerun-failed-serially",
+ dest="rerunFailedSerially",
+ action="store_true",
+ help="After the test run, rerun the tests that failed with a single "
+ "worker. Tests that pass the second time are reported as flaky",
+ )
+ execution_group.add_argument(
+ "--rerun-failed-matching",
+ dest="rerunFailedMatching",
+ metavar="REGEX",
+ type=_regex,
+ help="Only rerun failures whose output matches REGEX "
+ "(implies --rerun-failed-serially)",
+ )
execution_group.add_argument(
"--max-failures",
help="Stop execution after the given number of failures.",
@@ -568,6 +583,9 @@ def parse_args():
else:
opts.shard = None
+ if opts.rerunFailedMatching is not None:
+ opts.rerunFailedSerially = True
+
opts.reports = list(
filter(
None,
@@ -646,15 +664,21 @@ def _float(arg, kind, pred):
return f
-def _case_insensitive_regex(arg):
+def _regex(arg, flags=0):
import re
try:
- return re.compile(arg, re.IGNORECASE)
+ return re.compile(arg, flags)
except re.error as reason:
raise _error("invalid regular expression: '{}', {}", arg, reason)
+def _case_insensitive_regex(arg):
+ import re
+
+ return _regex(arg, re.IGNORECASE)
+
+
def _semicolon_list(arg):
return arg.split(";")
diff --git a/llvm/utils/lit/lit/main.py b/llvm/utils/lit/lit/main.py
index 801bdf6808d52..b37ddd765c16d 100755
--- a/llvm/utils/lit/lit/main.py
+++ b/llvm/utils/lit/lit/main.py
@@ -118,6 +118,8 @@ def main(builtin_params={}):
start = time.time()
run_tests(selected_tests, lit_config, opts, len(discovered_tests))
+ if opts.rerunFailedSerially:
+ rerun_failed_serially(selected_tests, lit_config, opts, len(discovered_tests))
elapsed = time.time() - start
if not opts.skip_test_time_recording:
@@ -258,8 +260,8 @@ def mark_excluded(discovered_tests, selected_tests):
t.setResult(result)
-def run_tests(tests, lit_config, opts, discovered_tests):
- workers = min(len(tests), opts.workers)
+def run_tests(tests, lit_config, opts, discovered_tests, workers=None):
+ workers = min(len(tests), opts.workers if workers is None else workers)
display = lit.display.create_display(opts, tests, discovered_tests, workers)
run = lit.run.Run(
@@ -287,6 +289,36 @@ def run_tests(tests, lit_config, opts, discovered_tests):
sys.stderr.write("%s, skipping remaining tests\n" % error)
+def rerun_failed_serially(tests, lit_config, opts, discovered_tests):
+ """Run the tests that failed a second time, with a single worker.
+
+ If opts.rerunFailedMatching is set, only reruns the tests whose output
+ matches it. Tests that pass the second time are reported as flaky, which
+ keeps them out of the failure count and the exit status.
+ """
+ matching = opts.rerunFailedMatching
+ failed = [
+ t
+ for t in tests
+ if t.isFailure()
+ and (matching is None or matching.search(t.result.output or ""))
+ ]
+ if not failed:
+ return
+
+ lit_config.note("rerunning %d failed test(s) with a single worker" % len(failed))
+ previous_results = [t.resetResult() for t in failed]
+
+ run_tests(failed, lit_config, opts, discovered_tests, workers=1)
+
+ for test, previous in zip(failed, previous_results):
+ if test.result.code is lit.Test.SKIPPED:
+ # The rerun was cut short, e.g. by --max-failures or a timeout.
+ test.resetResult(previous)
+ elif test.result.code is lit.Test.PASS:
+ test.result.code = lit.Test.FLAKYPASS
+
+
def execute_in_tmp_dir(run, lit_config):
# Create a temp directory inside the normal temp directory so that we can
# try to avoid temporary test file leaks. The user can avoid this behavior
diff --git a/llvm/utils/lit/tests/Inputs/rerun-failed-serially-retries/lit.cfg b/llvm/utils/lit/tests/Inputs/rerun-failed-serially-retries/lit.cfg
new file mode 100644
index 0000000000000..46619c136b434
--- /dev/null
+++ b/llvm/utils/lit/tests/Inputs/rerun-failed-serially-retries/lit.cfg
@@ -0,0 +1,10 @@
+import lit.formats
+
+config.name = "rerun-failed-serially-retries"
+config.suffixes = [".py"]
+config.test_format = lit.formats.ShTest()
+config.test_source_root = None
+config.test_exec_root = None
+
+config.substitutions.append(("%python", lit_config.params.get("python", "")))
+config.substitutions.append(("%counter", lit_config.params.get("counter", "")))
diff --git a/llvm/utils/lit/tests/Inputs/rerun-failed-serially-retries/needs-four-attempts.py b/llvm/utils/lit/tests/Inputs/rerun-failed-serially-retries/needs-four-attempts.py
new file mode 100644
index 0000000000000..c0a4e2a71e7b2
--- /dev/null
+++ b/llvm/utils/lit/tests/Inputs/rerun-failed-serially-retries/needs-four-attempts.py
@@ -0,0 +1,22 @@
+# RUN: "%python" "%s" "%counter"
+
+import os
+import sys
+
+counter_file = sys.argv[1]
+
+# A test that fails its first three attempts and passes on the fourth, so that
+# it outlives the in-place retries of the first pass.
+attempt = 1
+if os.path.exists(counter_file):
+ with open(counter_file, "r") as counter:
+ attempt = int(counter.read()) + 1
+
+with open(counter_file, "w") as counter:
+ counter.write(str(attempt))
+
+if attempt >= 4:
+ sys.exit(0)
+
+print("attempt %d failed while the machine was busy" % attempt)
+sys.exit(1)
diff --git a/llvm/utils/lit/tests/Inputs/rerun-failed-serially/always-fails.py b/llvm/utils/lit/tests/Inputs/rerun-failed-serially/always-fails.py
new file mode 100644
index 0000000000000..dd60685e54554
--- /dev/null
+++ b/llvm/utils/lit/tests/Inputs/rerun-failed-serially/always-fails.py
@@ -0,0 +1,3 @@
+# A test that fails no matter how many times it is run.
+
+# RUN: false
diff --git a/llvm/utils/lit/tests/Inputs/rerun-failed-serially/fails-once.py b/llvm/utils/lit/tests/Inputs/rerun-failed-serially/fails-once.py
new file mode 100644
index 0000000000000..105a9e14eff55
--- /dev/null
+++ b/llvm/utils/lit/tests/Inputs/rerun-failed-serially/fails-once.py
@@ -0,0 +1,17 @@
+# RUN: "%python" "%s" "%counter"
+
+import os
+import sys
+
+counter_file = sys.argv[1]
+
+# A test that fails the first time it is run and passes every time after that,
+# standing in for one that only fails while other tests are running.
+if os.path.exists(counter_file):
+ sys.exit(0)
+
+with open(counter_file, "w") as counter:
+ counter.write("1")
+
+print("failed while the machine was busy")
+sys.exit(1)
diff --git a/llvm/utils/lit/tests/Inputs/rerun-failed-serially/lit.cfg b/llvm/utils/lit/tests/Inputs/rerun-failed-serially/lit.cfg
new file mode 100644
index 0000000000000..6ed8a7254c34d
--- /dev/null
+++ b/llvm/utils/lit/tests/Inputs/rerun-failed-serially/lit.cfg
@@ -0,0 +1,10 @@
+import lit.formats
+
+config.name = "rerun-failed-serially"
+config.suffixes = [".py"]
+config.test_format = lit.formats.ShTest()
+config.test_source_root = None
+config.test_exec_root = None
+
+config.substitutions.append(("%python", lit_config.params.get("python", "")))
+config.substitutions.append(("%counter", lit_config.params.get("counter", "")))
diff --git a/llvm/utils/lit/tests/rerun-failed-serially.py b/llvm/utils/lit/tests/rerun-failed-serially.py
new file mode 100644
index 0000000000000..8d63486d5c0f2
--- /dev/null
+++ b/llvm/utils/lit/tests/rerun-failed-serially.py
@@ -0,0 +1,89 @@
+# Check the behavior of --rerun-failed-serially.
+
+# The test suite used here contains a test that fails the first time it is run
+# and passes on the rerun, and one that fails every time.
+
+# Without the option, the test that would pass on a rerun is just a failure.
+#
+# RUN: rm -f %t.counter
+# RUN: not %{lit} %{inputs}/rerun-failed-serially -Dcounter=%t.counter \
+# RUN: -Dpython=%{python} 2>&1 | \
+# RUN: FileCheck --check-prefix=CHECK-OFF %s
+#
+# CHECK-OFF: Failed Tests (2):
+# CHECK-OFF-NEXT: rerun-failed-serially :: always-fails.py
+# CHECK-OFF-NEXT: rerun-failed-serially :: fails-once.py
+# CHECK-OFF: Failed: 2
+
+# With the option, the failed tests are run again with a single worker. The one
+# that passes the second time is reported as flaky, the other one still fails.
+#
+# RUN: rm -f %t.counter
+# RUN: not %{lit} %{inputs}/rerun-failed-serially --rerun-failed-serially \
+# RUN: -Dcounter=%t.counter -Dpython=%{python} 2>&1 | \
+# RUN: FileCheck --check-prefix=CHECK-ON %s
+#
+# CHECK-ON: note: rerunning 2 failed test(s) with a single worker
+# CHECK-ON: -- Testing: 2 tests, 1 workers --
+# CHECK-ON: Failed Tests (1):
+# CHECK-ON-NEXT: rerun-failed-serially :: always-fails.py
+# CHECK-ON: Passed With Retry: 1
+# CHECK-ON: Failed{{ *}}: 1
+
+# --rerun-failed-matching restricts the rerun to the failures whose output
+# matches, so that a test failing for an unrelated reason is not given a
+# second chance.
+#
+# RUN: rm -f %t.counter
+# RUN: not %{lit} %{inputs}/rerun-failed-serially \
+# RUN: --rerun-failed-matching "machine was busy" \
+# RUN: -Dcounter=%t.counter -Dpython=%{python} 2>&1 | \
+# RUN: FileCheck --check-prefix=CHECK-MATCHING %s
+#
+# CHECK-MATCHING: note: rerunning 1 failed test(s) with a single worker
+# CHECK-MATCHING: Failed Tests (1):
+# CHECK-MATCHING-NEXT: rerun-failed-serially :: always-fails.py
+# CHECK-MATCHING: Passed With Retry: 1
+# CHECK-MATCHING: Failed{{ *}}: 1
+
+# A pattern that matches no failure at all reruns nothing.
+#
+# RUN: rm -f %t.counter
+# RUN: not %{lit} %{inputs}/rerun-failed-serially \
+# RUN: --rerun-failed-matching "no failure says this" \
+# RUN: -Dcounter=%t.counter -Dpython=%{python} 2>&1 | \
+# RUN: FileCheck --check-prefix=CHECK-NO-MATCH %s
+#
+# CHECK-NO-MATCH-NOT: rerunning
+# CHECK-NO-MATCH: Failed Tests (2):
+# CHECK-NO-MATCH-NEXT: rerun-failed-serially :: always-fails.py
+# CHECK-NO-MATCH-NEXT: rerun-failed-serially :: fails-once.py
+# CHECK-NO-MATCH: Failed: 2
+
+# The in-place retries of --max-retries-per-test come first, so only a failure
+# that outlives them reaches the serial rerun. The test used below needs four
+# attempts to pass; with two attempts per pass, the rerun is what gets it there
+# and lit reports the flaky pass itself.
+#
+# RUN: rm -f %t.counter
+# RUN: %{lit} %{inputs}/rerun-failed-serially-retries --max-retries-per-test 1 \
+# RUN: --rerun-failed-serially -Dcounter=%t.counter -Dpython=%{python} 2>&1 | \
+# RUN: FileCheck --check-prefix=CHECK-RETRIES %s
+#
+# CHECK-RETRIES: FAIL: rerun-failed-serially-retries :: needs-four-attempts.py (1 of 1, 2 of 2 attempts)
+# CHECK-RETRIES: note: rerunning 1 failed test(s) with a single worker
+# CHECK-RETRIES: FLAKYPASS: rerun-failed-serially-retries :: needs-four-attempts.py (1 of 1, 2 of 2 attempts)
+# CHECK-RETRIES: Passed With Retry: 1
+
+# With three attempts per pass, the fourth one is the first attempt of the
+# rerun, which passes, so the flaky pass comes from the rerun instead.
+#
+# RUN: rm -f %t.counter
+# RUN: %{lit} %{inputs}/rerun-failed-serially-retries --max-retries-per-test 2 \
+# RUN: --rerun-failed-serially -Dcounter=%t.counter -Dpython=%{python} 2>&1 | \
+# RUN: FileCheck --check-prefix=CHECK-RETRIES-PASS %s
+#
+# CHECK-RETRIES-PASS: FAIL: rerun-failed-serially-retries :: needs-four-attempts.py (1 of 1, 3 of 3 attempts)
+# CHECK-RETRIES-PASS: note: rerunning 1 failed test(s) with a single worker
+# CHECK-RETRIES-PASS: PASS: rerun-failed-serially-retries :: needs-four-attempts.py (1 of 1)
+# CHECK-RETRIES-PASS: Passed With Retry: 1
>From 0c7da27e031a648a6eec0a2aec9581133b68a316 Mon Sep 17 00:00:00 2001
From: Adrian Prantl <aprantl at apple.com>
Date: Wed, 16 Sep 2026 10:52:59 -0700
Subject: [PATCH 2/2] fixup! [lit] Add --rerun-failed-serially +
--rerun-failed-matching
---
llvm/docs/CommandGuide/lit.md | 21 ++++++++----------
llvm/utils/lit/lit/cl_arguments.py | 15 +++----------
llvm/utils/lit/lit/main.py | 17 ++++++--------
llvm/utils/lit/tests/rerun-failed-serially.py | 22 ++++++++++---------
4 files changed, 31 insertions(+), 44 deletions(-)
diff --git a/llvm/docs/CommandGuide/lit.md b/llvm/docs/CommandGuide/lit.md
index ee5b2ee1bbd90..4a612891cc1fa 100644
--- a/llvm/docs/CommandGuide/lit.md
+++ b/llvm/docs/CommandGuide/lit.md
@@ -237,11 +237,15 @@ require a change in the test scripts or the test config:
Any option in the list above overrules its predecessor.
:::
-:::{option} --rerun-failed-serially
-Once all tests have run, run the tests that failed a second time, with a
-single worker regardless of {option}`-j`. Tests that pass the second time
-are reported as `FLAKYPASS`, so they do not count as failures and do not
-affect the exit status.
+:::{option} --rerun-failed-serially REGEX
+Once all tests have run, run the tests whose failure output matches `REGEX`
+a second time, with a single worker regardless of {option}`-j`. Tests that
+pass the second time are reported as `FLAKYPASS`, so they do not count as
+failures and do not affect the exit status.
+
+Matching on the output is what allows working around very specific known
+issues without allowing other tests to become unreliable due to the retry
+mechanism. Pass `.` to rerun every failure.
{option}`--max-retries-per-test` retries a failed test immediately, in the
same worker and alongside the tests that are still running; this option
@@ -249,13 +253,6 @@ waits until nothing else is running. Both can be used at once, in which
case each attempt of the rerun is retried as well.
:::
-:::{option} --rerun-failed-matching REGEX
-Only rerun those failures whose output matches `REGEX`, to allow
-working around very specific known issues without allowing other
-tests to become unreliable due to the retry mechanism. Implies
-{option}`--rerun-failed-serially`.
-:::
-
:::{option} --allow-empty-runs
Do not fail the run if all tests are filtered out.
:::
diff --git a/llvm/utils/lit/lit/cl_arguments.py b/llvm/utils/lit/lit/cl_arguments.py
index c8fba2bdc940a..c13ab4e12e26a 100644
--- a/llvm/utils/lit/lit/cl_arguments.py
+++ b/llvm/utils/lit/lit/cl_arguments.py
@@ -369,17 +369,11 @@ def parse_args():
execution_group.add_argument(
"--rerun-failed-serially",
dest="rerunFailedSerially",
- action="store_true",
- help="After the test run, rerun the tests that failed with a single "
- "worker. Tests that pass the second time are reported as flaky",
- )
- execution_group.add_argument(
- "--rerun-failed-matching",
- dest="rerunFailedMatching",
metavar="REGEX",
type=_regex,
- help="Only rerun failures whose output matches REGEX "
- "(implies --rerun-failed-serially)",
+ help="After the test run, rerun the tests whose failure output matches "
+ "REGEX with a single worker. Tests that pass the second time are "
+ "reported as flaky",
)
execution_group.add_argument(
"--max-failures",
@@ -583,9 +577,6 @@ def parse_args():
else:
opts.shard = None
- if opts.rerunFailedMatching is not None:
- opts.rerunFailedSerially = True
-
opts.reports = list(
filter(
None,
diff --git a/llvm/utils/lit/lit/main.py b/llvm/utils/lit/lit/main.py
index b37ddd765c16d..a52085fe05a80 100755
--- a/llvm/utils/lit/lit/main.py
+++ b/llvm/utils/lit/lit/main.py
@@ -118,7 +118,7 @@ def main(builtin_params={}):
start = time.time()
run_tests(selected_tests, lit_config, opts, len(discovered_tests))
- if opts.rerunFailedSerially:
+ if opts.rerunFailedSerially is not None:
rerun_failed_serially(selected_tests, lit_config, opts, len(discovered_tests))
elapsed = time.time() - start
@@ -290,18 +290,15 @@ def run_tests(tests, lit_config, opts, discovered_tests, workers=None):
def rerun_failed_serially(tests, lit_config, opts, discovered_tests):
- """Run the tests that failed a second time, with a single worker.
+ """Run the tests whose failure output matches, a second time, with a
+ single worker.
- If opts.rerunFailedMatching is set, only reruns the tests whose output
- matches it. Tests that pass the second time are reported as flaky, which
- keeps them out of the failure count and the exit status.
+ Tests that pass the second time are reported as flaky, which keeps them
+ out of the failure count and the exit status.
"""
- matching = opts.rerunFailedMatching
+ matching = opts.rerunFailedSerially
failed = [
- t
- for t in tests
- if t.isFailure()
- and (matching is None or matching.search(t.result.output or ""))
+ t for t in tests if t.isFailure() and matching.search(t.result.output or "")
]
if not failed:
return
diff --git a/llvm/utils/lit/tests/rerun-failed-serially.py b/llvm/utils/lit/tests/rerun-failed-serially.py
index 8d63486d5c0f2..8f454e97f4b8d 100644
--- a/llvm/utils/lit/tests/rerun-failed-serially.py
+++ b/llvm/utils/lit/tests/rerun-failed-serially.py
@@ -15,11 +15,12 @@
# CHECK-OFF-NEXT: rerun-failed-serially :: fails-once.py
# CHECK-OFF: Failed: 2
-# With the option, the failed tests are run again with a single worker. The one
-# that passes the second time is reported as flaky, the other one still fails.
+# With a pattern that matches every failure, the failed tests are run again
+# with a single worker. The one that passes the second time is reported as
+# flaky, the other one still fails.
#
# RUN: rm -f %t.counter
-# RUN: not %{lit} %{inputs}/rerun-failed-serially --rerun-failed-serially \
+# RUN: not %{lit} %{inputs}/rerun-failed-serially --rerun-failed-serially . \
# RUN: -Dcounter=%t.counter -Dpython=%{python} 2>&1 | \
# RUN: FileCheck --check-prefix=CHECK-ON %s
#
@@ -30,13 +31,12 @@
# CHECK-ON: Passed With Retry: 1
# CHECK-ON: Failed{{ *}}: 1
-# --rerun-failed-matching restricts the rerun to the failures whose output
-# matches, so that a test failing for an unrelated reason is not given a
-# second chance.
+# A narrower pattern restricts the rerun to the failures whose output matches,
+# so that a test failing for an unrelated reason is not given a second chance.
#
# RUN: rm -f %t.counter
# RUN: not %{lit} %{inputs}/rerun-failed-serially \
-# RUN: --rerun-failed-matching "machine was busy" \
+# RUN: --rerun-failed-serially "machine was busy" \
# RUN: -Dcounter=%t.counter -Dpython=%{python} 2>&1 | \
# RUN: FileCheck --check-prefix=CHECK-MATCHING %s
#
@@ -50,7 +50,7 @@
#
# RUN: rm -f %t.counter
# RUN: not %{lit} %{inputs}/rerun-failed-serially \
-# RUN: --rerun-failed-matching "no failure says this" \
+# RUN: --rerun-failed-serially "no failure says this" \
# RUN: -Dcounter=%t.counter -Dpython=%{python} 2>&1 | \
# RUN: FileCheck --check-prefix=CHECK-NO-MATCH %s
#
@@ -67,7 +67,8 @@
#
# RUN: rm -f %t.counter
# RUN: %{lit} %{inputs}/rerun-failed-serially-retries --max-retries-per-test 1 \
-# RUN: --rerun-failed-serially -Dcounter=%t.counter -Dpython=%{python} 2>&1 | \
+# RUN: --rerun-failed-serially "machine was busy" \
+# RUN: -Dcounter=%t.counter -Dpython=%{python} 2>&1 | \
# RUN: FileCheck --check-prefix=CHECK-RETRIES %s
#
# CHECK-RETRIES: FAIL: rerun-failed-serially-retries :: needs-four-attempts.py (1 of 1, 2 of 2 attempts)
@@ -80,7 +81,8 @@
#
# RUN: rm -f %t.counter
# RUN: %{lit} %{inputs}/rerun-failed-serially-retries --max-retries-per-test 2 \
-# RUN: --rerun-failed-serially -Dcounter=%t.counter -Dpython=%{python} 2>&1 | \
+# RUN: --rerun-failed-serially "machine was busy" \
+# RUN: -Dcounter=%t.counter -Dpython=%{python} 2>&1 | \
# RUN: FileCheck --check-prefix=CHECK-RETRIES-PASS %s
#
# CHECK-RETRIES-PASS: FAIL: rerun-failed-serially-retries :: needs-four-attempts.py (1 of 1, 3 of 3 attempts)
More information about the llvm-commits
mailing list