[lit] Honor --max-time as an absolute deadline#202324
Open
prasoon054 wants to merge 1 commit into
Open
Conversation
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@gmail.com>
|
@llvm/pr-subscribers-testing-tools Author: Prasoon (prasoon054) ChangesCurrently, With this change, Full diff: https://github.com/llvm/llvm-project/pull/202324.diff 1 Files Affected:
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:
|
Contributor
Author
|
Windows failure is #202255 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently,
Run._wait_forsnapshots the time budget once and reuses it for everyAsyncResults.get(), so only the firstwaithonors the deadline.--max-timethen stops capping total testing time, a run can exceed it.With this change,
deadline-time.time()is recomputed on each wait.