From cb36616132434853707714cb548f03080950c08f Mon Sep 17 00:00:00 2001 From: Andrey Zelenkov Date: Fri, 30 Aug 2019 16:59:35 +0300 Subject: Tests: prevented writing to the closed socket for websocket tests. --- test/unit/applications/websockets.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/unit/applications/websockets.py b/test/unit/applications/websockets.py index 0a343875..47eebd9c 100644 --- a/test/unit/applications/websockets.py +++ b/test/unit/applications/websockets.py @@ -180,7 +180,10 @@ class TestApplicationWebsocket(TestApplicationProto): frame_len = len(frame) while pos < frame_len: end = min(pos + chopsize, frame_len) - sock.sendall(frame[pos:end]) + try: + sock.sendall(frame[pos:end]) + except BrokenPipeError: + end = frame_len pos = end def message(self, sock, type, message, fragmention_size=None, **kwargs): -- cgit