[llvm] r375165 - Reland "[lit] Synthesize artificial deadline"
Russell Gallop via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 23 07:39:39 PDT 2019
For the record, this was fixed in r375264.
Thanks
Russ
On Fri, 18 Oct 2019 at 13:30, Russell Gallop <russell.gallop at gmail.com>
wrote:
> Hi Julian,
>
> I see "timeout value is too large" errors with this version too, on
> Windows with python 3.6.8 (64bit):
>
> Example:
> >C:\Python36\python.exe --version
> Python 3.6.8
>
> >C:\Python36\python.exe bin/llvm-lit.py ../llvm/test/Other
> -- Testing: 107 tests, 12 workers --
> Traceback (most recent call last):
> File "bin/llvm-lit.py", line 42, in <module>
> main(builtin_parameters)
> File "<path...>/llvm-project/llvm\utils\lit\lit\main.py", line 97, in
> main
> testing_time = run_tests(tests, litConfig, opts, numTotalTests)
> File "<path...>/llvm-project/llvm\utils\lit\lit\main.py", line 222, in
> run_tests
> elapsed = run_tests_in_tmp_dir(run.execute, litConfig)
> File "<path...>/llvm-project/llvm\utils\lit\lit\main.py", line 256, in
> run_tests_in_tmp_dir
> return run_callback()
> File "<path...>/llvm-project/llvm\utils\lit\lit\run.py", line 54, in
> execute
> self._execute()
> File "<path...>/llvm-project/llvm\utils\lit\lit\run.py", line 149, in
> _execute
> a.wait(timeout)
> File "C:\Python36\lib\multiprocessing\pool.py", line 635, in wait
> self._event.wait(timeout)
> File "C:\Python36\lib\threading.py", line 551, in wait
> signaled = self._cond.wait(timeout)
> File "C:\Python36\lib\threading.py", line 299, in wait
> gotit = waiter.acquire(True, timeout)
> OverflowError: timeout value is too large
>
> Please can you take a look?
>
> Thanks
> Russ
>
> On Thu, 17 Oct 2019 at 21:19, Julian Lettner via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> Author: yln
>> Date: Thu Oct 17 13:22:32 2019
>> New Revision: 375165
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=375165&view=rev
>> Log:
>> Reland "[lit] Synthesize artificial deadline"
>>
>> We always want to use a deadline when calling `result.await`. Let's
>> synthesize an artificial deadline (now plus one year) to simplify code
>> and do less busy waiting.
>>
>> Thanks to Reid Kleckner for diagnosing that a deadline for of "positive
>> infinity" does not work with Python 3 anymore. See commit:
>> 4ff1e34b606d9a9fcfd8b8b5449a558315af94e5
>>
>> I tested this patch with Python 2 and Python 3.
>>
>> Modified:
>> llvm/trunk/utils/lit/lit/run.py
>>
>> Modified: llvm/trunk/utils/lit/lit/run.py
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/run.py?rev=375165&r1=375164&r2=375165&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/utils/lit/lit/run.py (original)
>> +++ llvm/trunk/utils/lit/lit/run.py Thu Oct 17 13:22:32 2019
>> @@ -12,6 +12,7 @@ class NopSemaphore(object):
>> def release(self): pass
>>
>> def create_run(tests, lit_config, workers, progress_callback, max_time):
>> + # TODO(yln) assert workers > 0
>> if workers == 1:
>> return SerialRun(tests, lit_config, progress_callback, max_time)
>> return ParallelRun(tests, lit_config, progress_callback, max_time,
>> workers)
>> @@ -107,11 +108,9 @@ class ParallelRun(Run):
>> self.workers = workers
>>
>> def _execute(self):
>> - # We need to issue many wait calls, so compute the final
>> deadline and
>> - # subtract time.time() from that as we go along.
>> - deadline = None
>> - if self.max_time:
>> - deadline = time.time() + self.max_time
>> + one_year = 365 * 24 * 60 * 60 # days * hours * minutes * seconds
>> + max_time = self.max_time or one_year
>> + deadline = time.time() + max_time
>>
>> semaphores = {
>> k: NopSemaphore() if v is None else
>> @@ -146,15 +145,10 @@ class ParallelRun(Run):
>> # Wait for all results to come in. The callback that runs in
>> the
>> # parent process will update the display.
>> for a in async_results:
>> - if deadline:
>> - a.wait(deadline - time.time())
>> - else:
>> - # Python condition variables cannot be interrupted
>> unless
>> - # they have a timeout. This can make lit
>> unresponsive to
>> - # KeyboardInterrupt, so do a busy wait with a
>> timeout.
>> - while not a.ready():
>> - a.wait(1)
>> + timeout = deadline - time.time()
>> + a.wait(timeout)
>> if not a.successful():
>> + # TODO(yln): this also raises on a --max-time time
>> a.get() # Exceptions raised here come from the
>> worker.
>> if self.hit_max_failures:
>> break
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191023/53d020ee/attachment.html>
More information about the llvm-commits
mailing list