[llvm] [lit] Honor --max-time as an absolute deadline (PR #202324)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 8 04:56:29 PDT 2026
https://github.com/prasoon054 created https://github.com/llvm/llvm-project/pull/202324
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.
>From 7b8472944a36401214337c8e9d891f426aedd2b4 Mon Sep 17 00:00:00 2001
From: Prasoon Kumar <prasoonkumar054 at gmail.com>
Date: Mon, 8 Jun 2026 15:53:32 +0530
Subject: [PATCH] [lit] Honor --max-time as an absolute deadline
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.
Signed-off-by: Prasoon Kumar <prasoonkumar054 at gmail.com>
---
llvm/utils/lit/lit/run.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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:
More information about the llvm-commits
mailing list