Tests: Add valid disconnect exceptions on Windows

This commit is contained in:
Roger Light
2026-05-03 01:17:26 +01:00
parent 9e9a172435
commit 78bfe27331
3 changed files with 4 additions and 4 deletions
@@ -38,7 +38,7 @@ def do_test():
mosq_test.do_client_connect(connect_packet_bad, connack_packet_bad, port=port)
print("did not throw when trying to open 11th connection (first time)")
return rc
except (ConnectionResetError, BrokenPipeError, OSError):
except (ConnectionAbortedError, ConnectionResetError, BrokenPipeError, OSError):
# Expected behaviour
pass
finally:
@@ -61,7 +61,7 @@ def do_test():
mosq_test.do_client_connect(connect_packet_bad, connack_packet_bad, port=port)
print("did not throw when trying to open 11th connection (second time)")
return rc
except (ConnectionResetError, BrokenPipeError, OSError):
except (ConnectionAbortedError, ConnectionResetError, BrokenPipeError, OSError):
# Expected behaviour
pass
finally:
+1 -1
View File
@@ -20,7 +20,7 @@ def test_iteration(port, connect_packets_ok, connack_packets_ok, connect_packet_
# Try to open an 11th connection
try:
sock_bad = mosq_test.do_client_connect(connect_packet_bad, connack_packet_bad, port=port)
except (ConnectionResetError, BrokenPipeError):
except (ConnectionAbortedError, ConnectionResetError, BrokenPipeError):
# Expected behaviour
pass
except OSError as e:
+1 -1
View File
@@ -158,7 +158,7 @@ class MsgSequence(object):
try:
if self._puback_check() and self.expect_disconnect:
raise ValueError("Still connected")
except ConnectionResetError:
except (ConnectionAbortedError, ConnectionResetError):
if self.expect_disconnect:
pass
else: