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 r3owen
Recipients asvetlov, fornellas, lisroach, miss-islington, r3owen, yselivanov
Date 2021-03-02.00:30:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1614645008.73.0.0645890065799.issue39101@roundup.psfhosted.org>
In-reply-to
Content
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)
History
Date User Action Args
2021-03-02 00:30:08r3owensetrecipients: + r3owen, asvetlov, yselivanov, lisroach, miss-islington, fornellas
2021-03-02 00:30:08r3owensetmessageid: <1614645008.73.0.0645890065799.issue39101@roundup.psfhosted.org>
2021-03-02 00:30:08r3owenlinkissue39101 messages
2021-03-02 00:30:08r3owencreate