]> granicus.if.org Git - python/commitdiff
Fix test_asyncio.test_timeout_disable()
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 18 Apr 2016 08:28:42 +0000 (10:28 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 18 Apr 2016 08:28:42 +0000 (10:28 +0200)
Issue #26777: Fix random failing of the test on the "AMD64 FreeBSD 9.x 3.5"
buildbot:

    File ".../Lib/test/test_asyncio/test_tasks.py", line 2398, in go
      self.assertTrue(0.09 < dt < 0.11, dt)
    AssertionError: False is not true : 0.11902812402695417

Replace "< 0.11" with "< 0.15".

Lib/test/test_asyncio/test_tasks.py

index 40e5f8830fe0c05c604a13ca19d9d7d51ff74d65..128b7ce9e56a707ab99dd31cf55fea881cfcca90 100644 (file)
@@ -2395,7 +2395,9 @@ class TimeoutTests(test_utils.TestCase):
                 resp = yield from long_running_task()
             self.assertEqual(resp, 'done')
             dt = self.loop.time() - t0
-            self.assertTrue(0.09 < dt < 0.11, dt)
+            # tolerate a time delta for clocks with bad resolution
+            # and slow buildbots
+            self.assertTrue(0.09 < dt < 0.15, dt)
         self.loop.run_until_complete(go())
 
     def test_raise_runtimeerror_if_no_task(self):