File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -1075,6 +1075,25 @@ def test_4_4_speculative_authentication_should_be_ignored_on_reauthentication(se
1075
1075
# Assert there were `SaslStart` commands executed.
1076
1076
assert any (event .command_name .lower () == "saslstart" for event in listener .started_events )
1077
1077
1078
+ def test_4_5_reauthentication_succeeds_when_a_session_is_involved (self ):
1079
+ # Create an OIDC configured client.
1080
+ client = self .create_client ()
1081
+
1082
+ # Set a fail point for `find` commands of the form:
1083
+ with self .fail_point (
1084
+ {
1085
+ "mode" : {"times" : 1 },
1086
+ "data" : {"failCommands" : ["find" ], "errorCode" : 391 },
1087
+ }
1088
+ ):
1089
+ # Start a new session.
1090
+ with client .start_session () as session :
1091
+ # In the started session perform a `find` operation that succeeds.
1092
+ client .test .test .find ({}, session = session )
1093
+
1094
+ # Assert that the callback was called 2 times (once during the connection handshake, and again during reauthentication).
1095
+ self .assertEqual (self .request_called , 2 )
1096
+
1078
1097
def test_5_1_azure_with_no_username (self ):
1079
1098
if ENVIRON != "azure" :
1080
1099
raise unittest .SkipTest ("Test is only supported on Azure" )
You can’t perform that action at this time.
0 commit comments