[test:websockets] Update server hang workaround (#17718)

Authored by: doe1080
This commit is contained in:
doe1080
2026-09-27 19:50:36 +02:00
committed by GitHub
parent 39b31b2755
commit 9dd5e68cd7
+5 -1
View File
@@ -130,7 +130,11 @@ def ws_validate_and_send(rh, req):
try:
return rh.send(req)
except TransportError as e:
if i < (max_tries - 1) and 'connection closed during handshake' in str(e):
if i < (max_tries - 1) and (
'connection closed during handshake' in str(e)
or (isinstance(e.cause, websockets.exceptions.InvalidMessage)
and isinstance(e.cause.__cause__, EOFError))
):
# websockets server sometimes hangs on new connections
continue
raise