Bug report
Bug description:
test.test_asyncio.test_ssl.TestSSL.test_remote_shutdown_receives_trailing_data_on_slow_socket reads the SSL protocol's underlying transport and patches its write:
socket_transport = writer.transport._ssl_protocol._transport
...
with unittest.mock.patch.object(
socket_transport, "write",
wraps=socket_transport.write,
side_effect=_fake_full_write_buffer
):
Immediately before this, the test fills the write backlog and reads until the remote shuts the connection down (catching BrokenPipeError / ConnectionResetError).
On a slow or loaded socket the remote shutdown can complete first, and connection_lost clears _SSLProtocolTransport's underlying transport (_ssl_protocol._transport becomes None), but the test still performs an attribute lookup:
Traceback (most recent call last):
File ".../test/test_asyncio/test_ssl.py", line ..., in client
wraps=socket_transport.write,
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'write'
This is a timing-dependent flake: the test assumes the underlying transport is still alive at this point.
CPython versions tested on:
CPython main branch, 3.16, 3.15, 3.14
Operating systems tested on:
Linux
Linked PRs
Bug report
Bug description:
test.test_asyncio.test_ssl.TestSSL.test_remote_shutdown_receives_trailing_data_on_slow_socketreads the SSL protocol's underlying transport and patches itswrite:Immediately before this, the test fills the write backlog and reads until the remote shuts the connection down (catching
BrokenPipeError/ConnectionResetError).On a slow or loaded socket the remote shutdown can complete first, and
connection_lostclears_SSLProtocolTransport's underlying transport (_ssl_protocol._transportbecomesNone), but the test still performs an attribute lookup:This is a timing-dependent flake: the test assumes the underlying transport is still alive at this point.
CPython versions tested on:
CPython main branch, 3.16, 3.15, 3.14
Operating systems tested on:
Linux
Linked PRs