This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients vstinner
Date 2019-01-30.17:23:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1548868997.2.0.322719880697.issue35760@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2019-01-30 17:23:19vstinnersetrecipients: + vstinner
2019-01-30 17:23:17vstinnersetmessageid: <1548868997.2.0.322719880697.issue35760@roundup.psfhosted.org>
2019-01-30 17:23:17vstinnerlinkissue35760 messages
2019-01-30 17:23:17vstinnercreate