[llvm] dc3d0b2 - [lit] don't skip test times when executions are instantaneous

Stella Stamenova via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 7 11:28:20 PST 2023


Author: Ashay Rane
Date: 2023-02-07T11:27:44-08:00
New Revision: dc3d0b266bd9b4c15cef3ed92ab1b60742a80188

URL: https://github.com/llvm/llvm-project/commit/dc3d0b266bd9b4c15cef3ed92ab1b60742a80188
DIFF: https://github.com/llvm/llvm-project/commit/dc3d0b266bd9b4c15cef3ed92ab1b60742a80188.diff

LOG: [lit] don't skip test times when executions are instantaneous

If a test executes quickly or if the timing resolution is too coarse,
the running time associated with a test could be zero. This happens
often for the //llvm/utils/lit/tests/reorder.py test on Windows, which
causes the test to fail non-deterministically.

This patch modifies the existing check, so that instead of skipping
zeros, lit now skips if the timing is None (presumably due to an error
in measurement). Recurring executions of the reorder.py test on Windows
seem to indicate that the test no longer exhibits occasional failure.

Reviewed By: stella.stamenova

Differential Revision: https://reviews.llvm.org/D143504

Added: 
    

Modified: 
    llvm/utils/lit/lit/TestTimes.py

Removed: 
    


################################################################################
diff  --git a/llvm/utils/lit/lit/TestTimes.py b/llvm/utils/lit/lit/TestTimes.py
index 8379cf5dfe182..3fc22203141f0 100644
--- a/llvm/utils/lit/lit/TestTimes.py
+++ b/llvm/utils/lit/lit/TestTimes.py
@@ -19,7 +19,7 @@ def record_test_times(tests, lit_config):
     times_by_suite = {}
     for t in tests:
         assert t.suite.test_times is None
-        if not t.result.elapsed:
+        if t.result.elapsed is None:
             continue
         if not t.suite.exec_root in times_by_suite:
             times_by_suite[t.suite.exec_root] = read_test_times(t.suite)


        


More information about the llvm-commits mailing list