bpo-42553: Fix test_asyncio.test_call_later() (GH-23627)

Fix test_asyncio.test_call_later() race condition: don't measure
asyncio performance in the call_later() unit test. The test failed
randomly on the CI.
(cherry picked from commit 7e5e13d113)

Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
Miss Islington (bot) 2020-12-03 05:20:07 -08:00 committed by GitHub
parent ae67db6b31
commit 9f26833ced
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -293,11 +293,8 @@ class EventLoopTestsMixin:
self.loop.stop()
self.loop.call_later(0.1, callback, 'hello world')
t0 = time.monotonic()
self.loop.run_forever()
t1 = time.monotonic()
self.assertEqual(results, ['hello world'])
self.assertTrue(0.08 <= t1-t0 <= 0.8, t1-t0)
def test_call_soon(self):
results = []

View file

@ -0,0 +1,3 @@
Fix ``test_asyncio.test_call_later()`` race condition: don't measure asyncio
performance in the ``call_later()`` unit test. The test failed randomly on
the CI.