Message387887
Here is a variant that also hangs, I suspect for the same reason. The task raises asyncio.CancelledError which inherits from BaseException and my guess is it somehow kills the event loop.
import asyncio
import unittest
class DemonstrateHang(unittest.IsolatedAsyncioTestCase):
async def test_hang(self):
task = asyncio.create_task(asyncio.sleep(2))
await asyncio.sleep(0.1)
task.cancel()
await task
# this also hangs: await asyncio.wait_for(task, 5) |
|
Date |
User |
Action |
Args |
2021-03-02 00:30:08 | r3owen | set | recipients:
+ r3owen, asvetlov, yselivanov, lisroach, miss-islington, fornellas |
2021-03-02 00:30:08 | r3owen | set | messageid: <1614645008.73.0.0645890065799.issue39101@roundup.psfhosted.org> |
2021-03-02 00:30:08 | r3owen | link | issue39101 messages |
2021-03-02 00:30:08 | r3owen | create | |
|