STINNER Victor <[email protected]> added the comment:
A test failed again on AppVeyor! In the 3.7 branch, on this test:
def busy_wait(duration):
deadline = time.monotonic() + duration
while time.monotonic() < deadline:
pass
(...)
def test_thread_time(self):
(...)
# bpo-33723: A busy loop of 100 ms should increase thread_time()
# by at least 15 ms, but less than 30 ms in other threads.
# Tolerate 15 and 30 ms because of the bad resolution
# of the clock on Windows (around 15.6 ms).
min_time = 0.015
max_time = 0.030
busy_time = 0.100
# thread_time() should include CPU time spent in current thread...
start = time.thread_time()
busy_wait(busy_time)
stop = time.thread_time()
self.assertGreaterEqual(stop - start, min_time) # <===== HERE =====
(...)
FAIL: test_thread_time (test.test_time.TimeTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\projects\cpython\lib\test\test_time.py", line 550, in
test_thread_time
self.assertGreaterEqual(stop - start, min_time)
AssertionError: 0.0 not greater than or equal to 0.015
IMHO the root issue is that time.thread_time() and time.monotonic() clocks are
just... unrelated... on Windows.
This time, I give up and wrote a PR to remove the "busy loop" tests, sorry! PR
10773.
----------
resolution: fixed ->
status: closed -> open
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue33723>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com