Skip to content

Commit 9f26833

Browse files
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 7e5e13d) Co-authored-by: Victor Stinner <[email protected]>
1 parent ae67db6 commit 9f26833

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Lib/test/test_asyncio/test_events.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,11 +293,8 @@ def callback(arg):
293293
self.loop.stop()
294294

295295
self.loop.call_later(0.1, callback, 'hello world')
296-
t0 = time.monotonic()
297296
self.loop.run_forever()
298-
t1 = time.monotonic()
299297
self.assertEqual(results, ['hello world'])
300-
self.assertTrue(0.08 <= t1-t0 <= 0.8, t1-t0)
301298

302299
def test_call_soon(self):
303300
results = []
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fix ``test_asyncio.test_call_later()`` race condition: don't measure asyncio
2+
performance in the ``call_later()`` unit test. The test failed randomly on
3+
the CI.

0 commit comments

Comments
 (0)