From 7e5e13d113798117d5ef25c5ffdbd0eb39420f98 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 3 Dec 2020 13:56:41 +0100 Subject: [PATCH] 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. --- Lib/test/test_asyncio/test_events.py | 3 --- .../NEWS.d/next/Tests/2020-12-03-13-32-44.bpo-42553.2TRE2N.rst | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 Misc/NEWS.d/next/Tests/2020-12-03-13-32-44.bpo-42553.2TRE2N.rst diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py index 7f76011d2b9..ce615606db7 100644 --- a/Lib/test/test_asyncio/test_events.py +++ b/Lib/test/test_asyncio/test_events.py @@ -294,11 +294,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 = [] diff --git a/Misc/NEWS.d/next/Tests/2020-12-03-13-32-44.bpo-42553.2TRE2N.rst b/Misc/NEWS.d/next/Tests/2020-12-03-13-32-44.bpo-42553.2TRE2N.rst new file mode 100644 index 00000000000..87221428472 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2020-12-03-13-32-44.bpo-42553.2TRE2N.rst @@ -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.