[llvm] [lit] Honor --max-time as an absolute deadline (PR #202324)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 8 04:57:06 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-testing-tools

Author: Prasoon (prasoon054)

<details>
<summary>Changes</summary>

Currently, `Run._wait_for` snapshots the time budget once and reuses it for every `AsyncResults.get()`, so only the first `wait` honors the deadline. `--max-time` then stops capping total testing time, a run can exceed it.

With this change, `deadline-time.time()` is recomputed on each wait.

---
Full diff: https://github.com/llvm/llvm-project/pull/202324.diff


1 Files Affected:

- (modified) llvm/utils/lit/lit/run.py (+2-2) 


``````````diff
diff --git a/llvm/utils/lit/lit/run.py b/llvm/utils/lit/lit/run.py
index 6c6d464a6881a..acab69365ebe0 100644
--- a/llvm/utils/lit/lit/run.py
+++ b/llvm/utils/lit/lit/run.py
@@ -16,6 +16,7 @@
 def _ceilDiv(a, b):
     return (a + b - 1) // b
 
+
 class MaxFailuresError(Exception):
     pass
 
@@ -141,12 +142,11 @@ def _execute(self, deadline):
                 pool.join()
 
     def _wait_for(self, async_results, deadline):
-        timeout = deadline - time.time()
         idx = 0
         while len(async_results) > 0:
             try:
                 ar = async_results.pop(0)
-                test = ar.get(timeout)
+                test = ar.get(deadline - time.time())
             except multiprocessing.TimeoutError:
                 raise TimeoutError()
             else:

``````````

</details>


https://github.com/llvm/llvm-project/pull/202324


More information about the llvm-commits mailing list