]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
asyncio: Relax timing requirement. Fixes issue 19579.
authorGuido van Rossum <guido@dropbox.com>
Thu, 14 Nov 2013 04:17:52 +0000 (20:17 -0800)
committerGuido van Rossum <guido@dropbox.com>
Thu, 14 Nov 2013 04:17:52 +0000 (20:17 -0800)
Lib/test/test_asyncio/test_base_events.py

index 9b883c5211e498eac152b0e64f79e6b916e020e1..3c4d52e6b9806546b3f6287d9513007d1d0d6d00 100644 (file)
@@ -170,7 +170,7 @@ class BaseEventLoopTests(unittest.TestCase):
         f.cancel()  # Don't complain about abandoned Future.
 
     def test__run_once(self):
-        h1 = events.TimerHandle(time.monotonic() + 0.1, lambda: True, ())
+        h1 = events.TimerHandle(time.monotonic() + 5.0, lambda: True, ())
         h2 = events.TimerHandle(time.monotonic() + 10.0, lambda: True, ())
 
         h1.cancel()
@@ -181,7 +181,7 @@ class BaseEventLoopTests(unittest.TestCase):
         self.loop._run_once()
 
         t = self.loop._selector.select.call_args[0][0]
-        self.assertTrue(9.99 < t < 10.1, t)
+        self.assertTrue(9.9 < t < 10.1, t)
         self.assertEqual([h2], self.loop._scheduled)
         self.assertTrue(self.loop._process_events.called)