From 051a33148813d045c33745ccd0e9e20e96b1bb6f Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 18 Oct 2013 15:15:56 -0700 Subject: Relax some asyncio test timeouts (http://bugs.python.org/issue19285). --- Lib/test/test_asyncio/test_base_events.py | 2 +- Lib/test/test_asyncio/test_events.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py index e62f476..db15244 100644 --- a/Lib/test/test_asyncio/test_base_events.py +++ b/Lib/test/test_asyncio/test_base_events.py @@ -121,7 +121,7 @@ class BaseEventLoopTests(unittest.TestCase): t0 = self.loop.time() self.loop.run_forever() t1 = self.loop.time() - self.assertTrue(0.09 <= t1-t0 <= 0.12, t1-t0) + self.assertTrue(0.09 <= t1-t0 <= 0.9, t1-t0) def test_run_once_in_executor_handle(self): def cb(): diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py index 2e89f72..4921e7f 100644 --- a/Lib/test/test_asyncio/test_events.py +++ b/Lib/test/test_asyncio/test_events.py @@ -215,7 +215,7 @@ class EventLoopTestsMixin: t0 = self.loop.time() self.loop.run_until_complete(tasks.sleep(0.1, loop=self.loop)) t1 = self.loop.time() - self.assertTrue(0.08 <= t1-t0 <= 0.12, t1-t0) + self.assertTrue(0.08 <= t1-t0 <= 0.8, t1-t0) def test_run_until_complete_stopped(self): @tasks.coroutine @@ -238,7 +238,7 @@ class EventLoopTestsMixin: self.loop.run_forever() t1 = time.monotonic() self.assertEqual(results, ['hello world']) - self.assertTrue(0.08 <= t1-t0 <= 0.2, t1-t0) + self.assertTrue(0.08 <= t1-t0 <= 0.8, t1-t0) def test_call_soon(self): results = [] @@ -462,8 +462,8 @@ class EventLoopTestsMixin: self.loop.add_signal_handler(signal.SIGALRM, my_handler, *some_args) - signal.setitimer(signal.ITIMER_REAL, 0.01, 0) # Send SIGALRM once. - self.loop.call_later(0.015, self.loop.stop) + signal.setitimer(signal.ITIMER_REAL, 0.1, 0) # Send SIGALRM once. + self.loop.call_later(0.5, self.loop.stop) self.loop.run_forever() self.assertEqual(caught, 1) -- cgit v0.12