Skip to content

Commit 67a0ab2

Browse files
committed
test(python-sdk): widen TLS retry to connection-lost races
The recorded TLS thread-safety race also manifests as ConnectionError from the reader (seen on CI's 3.13), not only TimeoutError; retry both.
1 parent 6ff0273 commit 67a0ab2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

sdks/python/tests/test_tcp_transport_e2e.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,11 @@ def _tls_call_with_retry(server: FakePeer, **transport_kwargs) -> tuple[TCPTrans
344344
transport.connect()
345345
resp_msg_id, _ = transport.call(protocol.MSG_INVOKE_REQUEST, b"secure-ping")
346346
return transport, resp_msg_id
347-
except TimeoutError as exc:
347+
except (TimeoutError, ConnectionError, OSError) as exc:
348+
# 竞态的两种表现:帧被静默吞掉(超时)或 reader 判定连接丢失
348349
last_exc = exc
349350
transport.close()
350-
raise AssertionError(f"TLS roundtrip kept timing out: {last_exc!r}")
351+
raise AssertionError(f"TLS roundtrip kept failing: {last_exc!r}")
351352

352353

353354
class TestTLS:

0 commit comments

Comments
 (0)