mirror of
https://github.com/python/cpython.git
synced 2026-04-25 21:30:45 +00:00
gh-143528: Fix test_time.test_thread_time() (#143558)
Tolerate 100 ms instead of 20 ms to support slow CIs.
This commit is contained in:
parent
f3e069a7ab
commit
efaa56f73c
1 changed files with 3 additions and 4 deletions
|
|
@ -580,11 +580,10 @@ def test_thread_time(self):
|
|||
|
||||
# thread_time() should not include time spend during a sleep
|
||||
start = time.thread_time()
|
||||
time.sleep(0.100)
|
||||
time.sleep(0.200)
|
||||
stop = time.thread_time()
|
||||
# use 20 ms because thread_time() has usually a resolution of 15 ms
|
||||
# on Windows
|
||||
self.assertLess(stop - start, 0.020)
|
||||
# gh-143528: use 100 ms to support slow CI
|
||||
self.assertLess(stop - start, 0.100)
|
||||
|
||||
info = time.get_clock_info('thread_time')
|
||||
self.assertTrue(info.monotonic)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue