summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-04-23 22:15:12 (GMT)
committerGitHub <noreply@github.com>2019-04-23 22:15:12 (GMT)
commitd246a6766b9d8cc625112906299c4cb019944300 (patch)
treeb4c5b47727444ffc14f750b6ce29d609289db0b2 /Lib
parent29d018aa63b72161cfc67602dc3dbd386272da64 (diff)
downloadcpython-d246a6766b9d8cc625112906299c4cb019944300.zip
cpython-d246a6766b9d8cc625112906299c4cb019944300.tar.gz
cpython-d246a6766b9d8cc625112906299c4cb019944300.tar.bz2
bpo-36454: Fix test_time.test_monotonic() (GH-12929)
Change test_time.test_monotonic() to test only the lower bound of elapsed time after a sleep command rather than the upper bound. This prevents unnecessary test failures on slow buildbots. Patch by Victor Stinner.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_time.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py
index 3039189..42799b2 100644
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -470,8 +470,9 @@ class TimeTestCase(unittest.TestCase):
t2 = time.monotonic()
dt = t2 - t1
self.assertGreater(t2, t1)
- # Issue #20101: On some Windows machines, dt may be slightly low
- self.assertTrue(0.45 <= dt <= 1.0, dt)
+ # bpo-20101: tolerate a difference of 50 ms because of bad timer
+ # resolution on Windows
+ self.assertTrue(0.450 <= dt)
# monotonic() is a monotonic but non adjustable clock
info = time.get_clock_info('monotonic')