Skip to content

Commit 8c097a4

Browse files
committed
[openmp] Allow to re-run tests
When packaging LLVM we've seen arbitrary tests failing. It happened sporadically and most of the times the test do work if they are run a second time on the next day. The tests themselves were always different and we didn't know ahead of time which ones we wanted to re-run. That's we [filter-out](https://src.fedoraproject.org/rpms/llvm/blob/rawhide/f/llvm.spec#_2326) a lot of `libomp` and `libarcher` tests. This changes allows us to set `LIT_OPTS="-Dmaximum_retries_per_test=12"` when running the "check-openmp" build target. Then any test in the `openmp` directory will at most be re-run 12 times. 12 is just an example here and it is up to the caller of the build target to define this. Please note, that only adds the possibility to re-run openmp tests. It does not actually do it until the caller specifies `-Dmaximum_retries_per_test=<INT>` either on a call to `lit` or in `LIT_OPTS`. Downstream ticket: https://issues.redhat.com/browse/LLVM-145
1 parent bbca78f commit 8c097a4

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

openmp/libompd/test/lit.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,7 @@ config.substitutions.append(("%ompt-tool",
8181

8282
config.substitutions.append(("FileCheck", config.test_filecheck))
8383

84+
maximum_retries_per_test = lit_config.params.get("maximum_retries_per_test", None)
85+
if maximum_retries_per_test is not None:
86+
config.test_retry_attempts = int(maximum_retries_per_test)
87+

openmp/runtime/test/lit.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,3 +226,7 @@ if config.has_ompt:
226226
config.substitutions.append(("%no-as-needed-flag", "-Wl,--no-as-needed"))
227227
else:
228228
config.substitutions.append(("FileCheck", config.test_filecheck))
229+
230+
maximum_retries_per_test = lit_config.params.get("maximum_retries_per_test", None)
231+
if maximum_retries_per_test is not None:
232+
config.test_retry_attempts = int(maximum_retries_per_test)

openmp/tools/archer/tests/lit.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,7 @@ elif config.operating_system == 'Darwin':
138138
config.substitutions.append(("%preload-tool", "env DYLD_INSERT_LIBRARIES=%T/tool.so"))
139139
else:
140140
config.substitutions.append(("%preload-tool", "env LD_PRELOAD=%T/tool.so"))
141+
142+
maximum_retries_per_test = lit_config.params.get("maximum_retries_per_test", None)
143+
if maximum_retries_per_test is not None:
144+
config.test_retry_attempts = int(maximum_retries_per_test)

openmp/tools/multiplex/tests/lit.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,6 @@ config.substitutions.append(("%clang", config.test_c_compiler))
103103
config.substitutions.append(("%openmp_flag", config.test_openmp_flags))
104104
config.substitutions.append(("%cflags", config.test_flags))
105105

106+
maximum_retries_per_test = lit_config.params.get("maximum_retries_per_test", None)
107+
if maximum_retries_per_test is not None:
108+
config.test_retry_attempts = int(maximum_retries_per_test)

0 commit comments

Comments
 (0)