Skip to content

Commit 6f82b25

Browse files
committed
Refactored TestTLSStream.test_receive_invalid_max_bytes() to be less flaky
1 parent be24b04 commit 6f82b25

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎tests/streams/test_tls.py‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,11 @@ async def test_receive_invalid_max_bytes(
112112

113113
def serve_sync() -> None:
114114
nonlocal server_exc
115-
conn, addr = server_sock.accept()
116115
try:
117-
conn.settimeout(5)
116+
conn, addr = server_sock.accept()
117+
conn.close()
118118
except BaseException as exc:
119119
server_exc = exc
120-
finally:
121-
conn.close()
122120

123121
server_sock = server_context.wrap_socket(
124122
socket.socket(), server_side=True, suppress_ragged_eofs=True
@@ -134,7 +132,6 @@ def serve_sync() -> None:
134132
stream,
135133
hostname="localhost",
136134
ssl_context=client_context,
137-
standard_compatible=False,
138135
)
139136
with pytest.raises(
140137
ValueError, match="max_bytes must be a positive integer"

0 commit comments

Comments
 (0)