Skip to content

Commit 930d537

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 12d2306 commit 930d537

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
@@ -291,11 +291,8 @@ def callback(arg):
291291
self.loop.stop()
292292

293293
self.loop.call_later(0.1, callback, 'hello world')
294-
t0 = time.monotonic()
295294
self.loop.run_forever()
296-
t1 = time.monotonic()
297295
self.assertEqual(results, ['hello world'])
298-
self.assertTrue(0.08 <= t1-t0 <= 0.8, t1-t0)
299296

300297
def test_call_soon(self):
301298
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)