From 60bc264e75bb96e9153758814035ad17f4474b9a Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 6 Dec 2024 16:32:29 +1000 Subject: [PATCH] test: ignore a failure to send a pong Our automatic pong handler unconditionally sends a Pong back to the EIS implementation. For some tests and depending on timing we may have been disconnected already, resulting in a BrokenPipeError that fails us the test. Ignore that error. Part-of: --- test/test_protocol.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/test_protocol.py b/test/test_protocol.py index 390582e..bae240f 100644 --- a/test/test_protocol.py +++ b/test/test_protocol.py @@ -287,7 +287,10 @@ class Ei: # Automatic ping/pong handler def ping(conn, id, version, new_objects={}): pingpong = new_objects["ping"] - ei.send(pingpong.Done(0)) + try: + ei.send(pingpong.Done(0)) + except BrokenPipeError: + pass ei.connection.connect("Ping", ping)