[3.13] gh-143528: Fix test_time.test_thread_time() (GH-143558) (#143560)

gh-143528: Fix test_time.test_thread_time() (GH-143558)

Tolerate 100 ms instead of 20 ms to support slow CIs.
(cherry picked from commit efaa56f73c)

Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
Miss Islington (bot) 2026-01-08 14:29:41 +01:00 committed by GitHub
parent 5af09f500b
commit cf0f4e6ebc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -571,11 +571,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)