STINNER Victor <vstin...@redhat.com> added the comment:
The bug can be triggered on Linux using this patch: diff --git a/Lib/test/test_asyncgen.py b/Lib/test/test_asyncgen.py index 71b0968c79..5e0084dc32 100644 --- a/Lib/test/test_asyncgen.py +++ b/Lib/test/test_asyncgen.py @@ -668,8 +668,8 @@ class AsyncGenAsyncioTest(unittest.TestCase): while True: yield 1 finally: - await asyncio.sleep(0.01) - await asyncio.sleep(0.01) + await asyncio.sleep(0.001) + await asyncio.sleep(0.001) DONE = 1 async def run(): @@ -678,7 +678,7 @@ class AsyncGenAsyncioTest(unittest.TestCase): await g.__anext__() del g - await asyncio.sleep(0.1) + await asyncio.sleep(0.005) self.loop.run_until_complete(run()) self.assertEqual(DONE, 1) And command: $ ./python -m test -j8 -F test_asyncgen -m test_async_gen_asyncio_gc_aclose_09 0:00:00 load avg: 7.30 [ 1] test_asyncgen passed 0:00:00 load avg: 7.30 [ 2] test_asyncgen passed 0:00:00 load avg: 7.30 [ 3] test_asyncgen passed (...) 0:00:02 load avg: 7.30 [ 38] test_asyncgen passed 0:00:02 load avg: 7.30 [ 39/1] test_asyncgen failed Task was destroyed but it is pending! task: <Task pending name='Task-2' coro=<<async_generator_athrow without __name__>()> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7fb9ad249aa0>()]>> test test_asyncgen failed -- Traceback (most recent call last): File "/home/vstinner/prog/python/master/Lib/test/test_asyncgen.py", line 684, in test_async_gen_asyncio_gc_aclose_09 self.assertEqual(DONE, 1) AssertionError: 0 != 1 0:00:02 load avg: 7.30 [ 40/1] test_asyncgen passed 0:00:03 load avg: 7.30 [ 41/1] test_asyncgen passed 0:00:03 load avg: 7.30 [ 42/1] test_asyncgen passed 0:00:03 load avg: 7.30 [ 43/1] test_asyncgen passed 0:00:03 load avg: 7.30 [ 44/1] test_asyncgen passed 0:00:03 load avg: 7.30 [ 45/1] test_asyncgen passed 0:00:03 load avg: 7.30 [ 46/1] test_asyncgen passed 0:00:03 load avg: 7.30 [ 47/1] test_asyncgen passed == Tests result: FAILURE == 46 tests OK. 1 test failed: test_asyncgen Total duration: 3 sec 323 ms Tests result: FAILURE ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue35760> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com