From 9dd5e68cd7adf3abc70d229ab6805d4686414f1b Mon Sep 17 00:00:00 2001 From: doe1080 <98906116+doe1080@users.noreply.github.com> Date: Mon, 28 Sep 2026 02:50:36 +0900 Subject: [PATCH] [test:websockets] Update server hang workaround (#17718) Authored by: doe1080 --- test/test_websockets.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/test_websockets.py b/test/test_websockets.py index 2b8488625d..57d5576875 100644 --- a/test/test_websockets.py +++ b/test/test_websockets.py @@ -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