From 96f20ae333b34175ece8ce44aefda62f70eb8e6f Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 6 Dec 2024 16:08:04 +1000 Subject: [PATCH] test: ignore a ConnectionResetError during our dispatch If our server disconnects us with data still in the pipe we never picked up on that data causing heisenbugs depending on whether we read things (esp. the "disconnected" event) fast enough or not. Part-of: --- test/test_protocol.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_protocol.py b/test/test_protocol.py index 38c28ea..390582e 100644 --- a/test/test_protocol.py +++ b/test/test_protocol.py @@ -233,7 +233,7 @@ class Ei: while data: self._data += data data = self.sock.recv(1024) - except BlockingIOError: + except (BlockingIOError, ConnectionResetError): pass return self.data