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