Skip to content

Commit 7ce39d8

Browse files
committed
[Lit] Sort previously failed tests early
D98179 added a mechanism to sort tests by test time to run slow tests early, increasing potential parallelism. It also added a feature where negative tests would be marked as negative, allowing subsequent test runs to run them earlier. Unfortunately it never actually stored the negative time, even if all the other code seemed to be inplace to sort them early. Luckily the fix seems simple. Differential Revision: https://reviews.llvm.org/D130570
1 parent 1a6d82b commit 7ce39d8

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

llvm/utils/lit/lit/TestTimes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def record_test_times(tests, lit_config):
2828
# used as an actual path to a filesystem API, therefore we use '/' as
2929
# the canonical separator so that Unix and Windows machines can share
3030
# timing data.
31-
times_by_suite[t.suite.exec_root]['/'.join(t.path_in_suite)] = t.result.elapsed
31+
times_by_suite[t.suite.exec_root]['/'.join(t.path_in_suite)] = time
3232

3333
for s, value in times_by_suite.items():
3434
try:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
42.0 not-executed.txt
22
3.0 subdir/ccc.txt
33
2.0 bbb.txt
4+
-0.2 fff.txt
45
0.1 aaa.txt
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# RUN: false

llvm/utils/lit/tests/reorder.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Check that we can reorder test runs.
22

33
# RUN: cp %{inputs}/reorder/.lit_test_times.txt %{inputs}/reorder/.lit_test_times.txt.orig
4-
# RUN: %{lit-no-order-opt} %{inputs}/reorder > %t.out
4+
# RUN: not %{lit-no-order-opt} %{inputs}/reorder > %t.out
55
# RUN: cp %{inputs}/reorder/.lit_test_times.txt %{inputs}/reorder/.lit_test_times.txt.new
66
# RUN: cp %{inputs}/reorder/.lit_test_times.txt.orig %{inputs}/reorder/.lit_test_times.txt
77
# RUN: not diff %{inputs}/reorder/.lit_test_times.txt.new %{inputs}/reorder/.lit_test_times.txt.orig
@@ -12,10 +12,12 @@
1212
# TIMES: not-executed.txt
1313
# TIMES-NEXT: subdir/ccc.txt
1414
# TIMES-NEXT: bbb.txt
15+
# TIMES-NEXT: -{{.*}} fff.txt
1516
# TIMES-NEXT: aaa.txt
1617
# TIMES-NEXT: new-test.txt
1718

18-
# CHECK: -- Testing: 4 tests, 1 workers --
19+
# CHECK: -- Testing: 5 tests, 1 workers --
20+
# CHECK-NEXT: FAIL: reorder :: fff.txt
1921
# CHECK-NEXT: PASS: reorder :: subdir/ccc.txt
2022
# CHECK-NEXT: PASS: reorder :: bbb.txt
2123
# CHECK-NEXT: PASS: reorder :: aaa.txt

0 commit comments

Comments
 (0)