Skip to content

Commit

Permalink
bpo-42553: Fix test_asyncio.test_call_later() (pythonGH-23627)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vstinner authored and adorilson committed Mar 11, 2021
1 parent 49d0fb4 commit 14e486e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 0 additions & 3 deletions Lib/test/test_asyncio/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,8 @@ def callback(arg):
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 = []
Expand Down
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 14e486e

Please sign in to comment.