From 064300865557f2d694d8712fe1e16226d9eb4a77 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 1 Dec 2025 09:10:38 -0600 Subject: [PATCH] cleanup --- .../test_discovery_and_monitoring.py | 3 +++ .../errors/error_handling_handshake.json | 16 ++++++++++++---- test/test_discovery_and_monitoring.py | 3 +++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/test/asynchronous/test_discovery_and_monitoring.py b/test/asynchronous/test_discovery_and_monitoring.py index 67df478b9f..e50ed78fb8 100644 --- a/test/asynchronous/test_discovery_and_monitoring.py +++ b/test/asynchronous/test_discovery_and_monitoring.py @@ -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 diff --git a/test/discovery_and_monitoring/errors/error_handling_handshake.json b/test/discovery_and_monitoring/errors/error_handling_handshake.json index 56ca7d1132..bf83f46f6a 100644 --- a/test/discovery_and_monitoring/errors/error_handling_handshake.json +++ b/test/discovery_and_monitoring/errors/error_handling_handshake.json @@ -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" } diff --git a/test/test_discovery_and_monitoring.py b/test/test_discovery_and_monitoring.py index 2318f259ed..3a96db0abe 100644 --- a/test/test_discovery_and_monitoring.py +++ b/test/test_discovery_and_monitoring.py @@ -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