diff options
author | Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> | 2022-10-24 20:21:42 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-24 20:21:42 (GMT) |
commit | ad1dc3ebb6aadaeeeacde13d4ed2d62bf302bf62 (patch) | |
tree | e52f65e2e56d35c0b7901578527c054f8fc62bf7 /Lib/test/test_asyncio | |
parent | e3b9dd8e870a61016e0f221e30d4f7d0b99cddb3 (diff) | |
download | cpython-ad1dc3ebb6aadaeeeacde13d4ed2d62bf302bf62.zip cpython-ad1dc3ebb6aadaeeeacde13d4ed2d62bf302bf62.tar.gz cpython-ad1dc3ebb6aadaeeeacde13d4ed2d62bf302bf62.tar.bz2 |
GH-89237: fix hang in proactor `subprocess.wait_closed()` (#98572)
Diffstat (limited to 'Lib/test/test_asyncio')
-rw-r--r-- | Lib/test/test_asyncio/test_proactor_events.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_asyncio/test_proactor_events.py b/Lib/test/test_asyncio/test_proactor_events.py index 7fca054..7fd8b26 100644 --- a/Lib/test/test_asyncio/test_proactor_events.py +++ b/Lib/test/test_asyncio/test_proactor_events.py @@ -290,7 +290,12 @@ class ProactorSocketTransportTests(test_utils.TestCase): tr._closing = True tr._force_close(None) test_utils.run_briefly(self.loop) - self.assertFalse(self.protocol.connection_lost.called) + # See https://github.com/python/cpython/issues/89237 + # `protocol.connection_lost` should be called even if + # the transport was closed forcefully otherwise + # the resources held by protocol will never be freed + # and waiters will never be notified leading to hang. + self.assertTrue(self.protocol.connection_lost.called) def test_fatal_error_2(self): tr = self.socket_transport() |