mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-08-20 21:41:40 +08:00
Tests: Add valid disconnect exceptions on Windows
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user