diff --git a/test/integration/auth/mongodb_oidc.prose.test.ts b/test/integration/auth/mongodb_oidc.prose.test.ts index 66aabda7e84..9115b0248d8 100644 --- a/test/integration/auth/mongodb_oidc.prose.test.ts +++ b/test/integration/auth/mongodb_oidc.prose.test.ts @@ -318,6 +318,7 @@ describe('OIDC Auth Spec Tests', function () { }); afterEach(async function () { + // explicitly remove the fail point to prevent interaction betweet test runs await utilClient.db().admin().command({ configureFailPoint: 'failCommand', mode: 'off' @@ -402,6 +403,7 @@ describe('OIDC Auth Spec Tests', function () { }); afterEach(async function () { + // explicitly remove the fail point to prevent interaction betweet test runs await utilClient.db().admin().command({ configureFailPoint: 'failCommand', mode: 'off' @@ -457,6 +459,7 @@ describe('OIDC Auth Spec Tests', function () { }); afterEach(async function () { + // explicitly remove the fail point to prevent interaction betweet test runs await utilClient.db().admin().command({ configureFailPoint: 'failCommand', mode: 'off' @@ -522,6 +525,7 @@ describe('OIDC Auth Spec Tests', function () { }); afterEach(async function () { + // explicitly remove the fail point to prevent interaction betweet test runs await utilClient?.db().admin().command({ configureFailPoint: 'failCommand', mode: 'off' @@ -587,6 +591,7 @@ describe('OIDC Auth Spec Tests', function () { }); afterEach(async function () { + // explicitly remove the fail point to prevent interaction betweet test runs await utilClient?.db().admin().command({ configureFailPoint: 'failCommand', mode: 'off' @@ -654,6 +659,7 @@ describe('OIDC Auth Spec Tests', function () { }); afterEach(async function () { + // explicitly remove the fail point to prevent interaction betweet test runs await utilClient?.db().admin().command({ configureFailPoint: 'failCommand', mode: 'off' @@ -733,6 +739,7 @@ describe('OIDC Auth Spec Tests', function () { }); afterEach(async function () { + // explicitly remove the fail point to prevent interaction betweet test runs await utilClient.db().admin().command({ configureFailPoint: 'failCommand', mode: 'off' @@ -1089,6 +1096,7 @@ describe('OIDC Auth Spec Tests', function () { }); afterEach(async function () { + // explicitly remove the fail point to prevent interaction betweet test runs await utilClient.db().admin().command({ configureFailPoint: 'failCommand', mode: 'off' @@ -1190,6 +1198,7 @@ describe('OIDC Auth Spec Tests', function () { }); afterEach(async function () { + // explicitly remove the fail point to prevent interaction betweet test runs await utilClient.db().admin().command({ configureFailPoint: 'failCommand', mode: 'off' @@ -1252,6 +1261,7 @@ describe('OIDC Auth Spec Tests', function () { }); afterEach(async function () { + // explicitly remove the fail point to prevent interaction betweet test runs await utilClient.db().admin().command({ configureFailPoint: 'failCommand', mode: 'off' @@ -1348,6 +1358,7 @@ describe('OIDC Auth Spec Tests', function () { }); afterEach(async function () { + // explicitly remove the fail point to prevent interaction betweet test runs await utilClient.db().admin().command({ configureFailPoint: 'failCommand', mode: 'off' @@ -1419,6 +1430,7 @@ describe('OIDC Auth Spec Tests', function () { }); afterEach(async function () { + // explicitly remove the fail point to prevent interaction betweet test runs await utilClient.db().admin().command({ configureFailPoint: 'failCommand', mode: 'off' @@ -1496,6 +1508,7 @@ describe('OIDC Auth Spec Tests', function () { }); afterEach(async function () { + // explicitly remove the fail point to prevent interaction betweet test runs await utilClient.db().admin().command({ configureFailPoint: 'failCommand', mode: 'off' @@ -1581,6 +1594,7 @@ describe('OIDC Auth Spec Tests', function () { }); afterEach(async function () { + // explicitly remove the fail point to prevent interaction betweet test runs await utilClient.db().admin().command({ configureFailPoint: 'failCommand', mode: 'off' diff --git a/test/spec/auth/unified/mongodb-oidc-no-retry.json b/test/spec/auth/unified/mongodb-oidc-no-retry.json index 9dbe1982704..b32ada172a4 100644 --- a/test/spec/auth/unified/mongodb-oidc-no-retry.json +++ b/test/spec/auth/unified/mongodb-oidc-no-retry.json @@ -5,7 +5,8 @@ { "minServerVersion": "7.0", "auth": true, - "authMechanism": "MONGODB-OIDC" + "authMechanism": "MONGODB-OIDC", + "serverless": "forbid" } ], "createEntities": [ @@ -24,7 +25,8 @@ "$$placeholder": 1 }, "retryReads": false, - "retryWrites": false + "retryWrites": false, + "appName": "mongodb-oidc-no-retry" }, "observeEvents": [ "commandStartedEvent", @@ -146,7 +148,8 @@ "failCommands": [ "find" ], - "errorCode": 391 + "errorCode": 391, + "appName": "mongodb-oidc-no-retry" } } } @@ -211,7 +214,8 @@ "failCommands": [ "insert" ], - "errorCode": 391 + "errorCode": 391, + "appName": "mongodb-oidc-no-retry" } } } @@ -288,7 +292,8 @@ "failCommands": [ "insert" ], - "closeConnection": true + "closeConnection": true, + "appName": "mongodb-oidc-no-retry" } } } @@ -320,7 +325,8 @@ "failCommands": [ "saslStart" ], - "errorCode": 18 + "errorCode": 18, + "appName": "mongodb-oidc-no-retry" } } } @@ -397,7 +403,8 @@ "failCommands": [ "saslStart" ], - "errorCode": 18 + "errorCode": 18, + "appName": "mongodb-oidc-no-retry" } } } diff --git a/test/spec/auth/unified/mongodb-oidc-no-retry.yml b/test/spec/auth/unified/mongodb-oidc-no-retry.yml index 426fd72466c..dbfe4ef79e6 100644 --- a/test/spec/auth/unified/mongodb-oidc-no-retry.yml +++ b/test/spec/auth/unified/mongodb-oidc-no-retry.yml @@ -5,6 +5,7 @@ runOnRequirements: - minServerVersion: "7.0" auth: true authMechanism: "MONGODB-OIDC" + serverless: forbid createEntities: - client: id: &failPointClient failPointClient @@ -20,6 +21,7 @@ createEntities: authMechanismProperties: { $$placeholder: 1 } retryReads: false retryWrites: false + appName: &appName mongodb-oidc-no-retry observeEvents: - commandStartedEvent - commandSucceededEvent @@ -86,6 +88,7 @@ tests: failCommands: - find errorCode: 391 # ReauthenticationRequired + appName: *appName - name: find object: collection0 arguments: @@ -120,6 +123,7 @@ tests: failCommands: - insert errorCode: 391 # ReauthenticationRequired + appName: *appName - name: insertOne object: collection0 arguments: @@ -159,6 +163,7 @@ tests: failCommands: - insert closeConnection: true + appName: *appName - name: insertOne object: collection0 arguments: @@ -179,6 +184,7 @@ tests: failCommands: - saslStart errorCode: 18 + appName: *appName - name: insertOne object: collection0 arguments: @@ -212,12 +218,13 @@ tests: client: failPointClient failPoint: configureFailPoint: failCommand - mode: + mode: times: 1 data: failCommands: - saslStart errorCode: 18 + appName: *appName - name: insertOne object: collection0 arguments: @@ -225,4 +232,4 @@ tests: _id: 1 x: 1 expectError: - errorCode: 18 \ No newline at end of file + errorCode: 18 diff --git a/test/tools/unified-spec-runner/entities.ts b/test/tools/unified-spec-runner/entities.ts index 534071749a5..0edf984addb 100644 --- a/test/tools/unified-spec-runner/entities.ts +++ b/test/tools/unified-spec-runner/entities.ts @@ -265,6 +265,17 @@ export class UnifiedMongoClient extends MongoClient { }; } + // Test descriptions use `appName` and `appname` interchangeably + if ( + description.uriOptions && + (description.uriOptions.appName != null || description.uriOptions.appname != null) + ) { + options.appName = description.uriOptions.appName ?? description.uriOptions.appname; + } else { + const appNameNonce = new Date().getTime().toString(); + options.appName = `unified-spec-runner-${appNameNonce}`; + } + super(uri, options); this.observedEventEmitter.on('error', () => null); this.logCollector = logCollector;