PYTHON-5715 Add appName to OIDC test failpoints
This commit is contained in:
parent
e077ebd926
commit
2aacf4c39f
@ -104,7 +104,7 @@ class OIDCTestBase(AsyncPyMongoTestCase):
|
||||
|
||||
@asynccontextmanager
|
||||
async def fail_point(self, command_args):
|
||||
cmd_on = SON([("configureFailPoint", "failCommand")])
|
||||
cmd_on = dict(configureFailPoint="failCommand", appName="auth_oidc")
|
||||
cmd_on.update(command_args)
|
||||
client = AsyncMongoClient(self.uri_admin)
|
||||
await client.admin.command(cmd_on)
|
||||
@ -112,7 +112,7 @@ class OIDCTestBase(AsyncPyMongoTestCase):
|
||||
yield
|
||||
finally:
|
||||
await client.admin.command(
|
||||
"configureFailPoint", cmd_on["configureFailPoint"], mode="off"
|
||||
"configureFailPoint", cmd_on["configureFailPoint"], mode="off", appName="auth_oidc"
|
||||
)
|
||||
await client.close()
|
||||
|
||||
|
||||
@ -25,7 +25,8 @@
|
||||
"$$placeholder": 1
|
||||
},
|
||||
"retryReads": false,
|
||||
"retryWrites": false
|
||||
"retryWrites": false,
|
||||
"appName": "mongodb-oidc-no-retry"
|
||||
},
|
||||
"observeEvents": [
|
||||
"commandStartedEvent",
|
||||
@ -147,7 +148,8 @@
|
||||
"failCommands": [
|
||||
"find"
|
||||
],
|
||||
"errorCode": 391
|
||||
"errorCode": 391,
|
||||
"appName": "mongodb-oidc-no-retry"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -212,7 +214,8 @@
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorCode": 391
|
||||
"errorCode": 391,
|
||||
"appName": "mongodb-oidc-no-retry"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -289,7 +292,8 @@
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"closeConnection": true
|
||||
"closeConnection": true,
|
||||
"appName": "mongodb-oidc-no-retry"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -321,7 +325,8 @@
|
||||
"failCommands": [
|
||||
"saslStart"
|
||||
],
|
||||
"errorCode": 18
|
||||
"errorCode": 18,
|
||||
"appName": "mongodb-oidc-no-retry"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -398,7 +403,8 @@
|
||||
"failCommands": [
|
||||
"saslStart"
|
||||
],
|
||||
"errorCode": 18
|
||||
"errorCode": 18,
|
||||
"appName": "mongodb-oidc-no-retry"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -104,14 +104,16 @@ class OIDCTestBase(PyMongoTestCase):
|
||||
|
||||
@contextmanager
|
||||
def fail_point(self, command_args):
|
||||
cmd_on = SON([("configureFailPoint", "failCommand")])
|
||||
cmd_on = dict(configureFailPoint="failCommand", appName="auth_oidc")
|
||||
cmd_on.update(command_args)
|
||||
client = MongoClient(self.uri_admin)
|
||||
client.admin.command(cmd_on)
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
client.admin.command("configureFailPoint", cmd_on["configureFailPoint"], mode="off")
|
||||
client.admin.command(
|
||||
"configureFailPoint", cmd_on["configureFailPoint"], mode="off", appName="auth_oidc"
|
||||
)
|
||||
client.close()
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user