PYTHON-5517 update SDAM error handling tests to ignore handshake failures (#2631)
This commit is contained in:
parent
0010325aa8
commit
d767759ff4
@ -145,6 +145,9 @@ async def got_app_error(topology, app_error):
|
||||
raise AssertionError
|
||||
except (AutoReconnect, NotPrimaryError, OperationFailure) as e:
|
||||
if when == "beforeHandshakeCompletes":
|
||||
# The pool would have added the SystemOverloadedError in this case.
|
||||
if isinstance(e, AutoReconnect):
|
||||
e._add_error_label("SystemOverloadedError")
|
||||
completed_handshake = False
|
||||
elif when == "afterHandshakeCompletes":
|
||||
completed_handshake = True
|
||||
|
||||
@ -97,14 +97,22 @@
|
||||
"outcome": {
|
||||
"servers": {
|
||||
"a:27017": {
|
||||
"type": "Unknown",
|
||||
"topologyVersion": null,
|
||||
"type": "RSPrimary",
|
||||
"setName": "rs",
|
||||
"topologyVersion": {
|
||||
"processId": {
|
||||
"$oid": "000000000000000000000001"
|
||||
},
|
||||
"counter": {
|
||||
"$numberLong": "1"
|
||||
}
|
||||
},
|
||||
"pool": {
|
||||
"generation": 1
|
||||
"generation": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
"topologyType": "ReplicaSetNoPrimary",
|
||||
"topologyType": "ReplicaSetWithPrimary",
|
||||
"logicalSessionTimeoutMinutes": null,
|
||||
"setName": "rs"
|
||||
}
|
||||
|
||||
@ -145,6 +145,9 @@ def got_app_error(topology, app_error):
|
||||
raise AssertionError
|
||||
except (AutoReconnect, NotPrimaryError, OperationFailure) as e:
|
||||
if when == "beforeHandshakeCompletes":
|
||||
# The pool would have added the SystemOverloadedError in this case.
|
||||
if isinstance(e, AutoReconnect):
|
||||
e._add_error_label("SystemOverloadedError")
|
||||
completed_handshake = False
|
||||
elif when == "afterHandshakeCompletes":
|
||||
completed_handshake = True
|
||||
|
||||
Loading…
Reference in New Issue
Block a user