Skip to content

Commit ed8cc54

Browse files
committed
configure appName and explicitly remove fail points
1 parent 5d3d3fc commit ed8cc54

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

test/integration/auth/mongodb_oidc.prose.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ describe('OIDC Auth Spec Tests', function () {
318318
});
319319

320320
afterEach(async function () {
321+
// explicitly remove the fail point to prevent interaction betweet test runs
321322
await utilClient.db().admin().command({
322323
configureFailPoint: 'failCommand',
323324
mode: 'off'
@@ -402,6 +403,7 @@ describe('OIDC Auth Spec Tests', function () {
402403
});
403404

404405
afterEach(async function () {
406+
// explicitly remove the fail point to prevent interaction betweet test runs
405407
await utilClient.db().admin().command({
406408
configureFailPoint: 'failCommand',
407409
mode: 'off'
@@ -457,6 +459,7 @@ describe('OIDC Auth Spec Tests', function () {
457459
});
458460

459461
afterEach(async function () {
462+
// explicitly remove the fail point to prevent interaction betweet test runs
460463
await utilClient.db().admin().command({
461464
configureFailPoint: 'failCommand',
462465
mode: 'off'
@@ -522,6 +525,7 @@ describe('OIDC Auth Spec Tests', function () {
522525
});
523526

524527
afterEach(async function () {
528+
// explicitly remove the fail point to prevent interaction betweet test runs
525529
await utilClient?.db().admin().command({
526530
configureFailPoint: 'failCommand',
527531
mode: 'off'
@@ -587,6 +591,7 @@ describe('OIDC Auth Spec Tests', function () {
587591
});
588592

589593
afterEach(async function () {
594+
// explicitly remove the fail point to prevent interaction betweet test runs
590595
await utilClient?.db().admin().command({
591596
configureFailPoint: 'failCommand',
592597
mode: 'off'
@@ -654,6 +659,7 @@ describe('OIDC Auth Spec Tests', function () {
654659
});
655660

656661
afterEach(async function () {
662+
// explicitly remove the fail point to prevent interaction betweet test runs
657663
await utilClient?.db().admin().command({
658664
configureFailPoint: 'failCommand',
659665
mode: 'off'
@@ -733,6 +739,7 @@ describe('OIDC Auth Spec Tests', function () {
733739
});
734740

735741
afterEach(async function () {
742+
// explicitly remove the fail point to prevent interaction betweet test runs
736743
await utilClient.db().admin().command({
737744
configureFailPoint: 'failCommand',
738745
mode: 'off'
@@ -1089,6 +1096,7 @@ describe('OIDC Auth Spec Tests', function () {
10891096
});
10901097

10911098
afterEach(async function () {
1099+
// explicitly remove the fail point to prevent interaction betweet test runs
10921100
await utilClient.db().admin().command({
10931101
configureFailPoint: 'failCommand',
10941102
mode: 'off'
@@ -1190,6 +1198,7 @@ describe('OIDC Auth Spec Tests', function () {
11901198
});
11911199

11921200
afterEach(async function () {
1201+
// explicitly remove the fail point to prevent interaction betweet test runs
11931202
await utilClient.db().admin().command({
11941203
configureFailPoint: 'failCommand',
11951204
mode: 'off'
@@ -1252,6 +1261,7 @@ describe('OIDC Auth Spec Tests', function () {
12521261
});
12531262

12541263
afterEach(async function () {
1264+
// explicitly remove the fail point to prevent interaction betweet test runs
12551265
await utilClient.db().admin().command({
12561266
configureFailPoint: 'failCommand',
12571267
mode: 'off'
@@ -1348,6 +1358,7 @@ describe('OIDC Auth Spec Tests', function () {
13481358
});
13491359

13501360
afterEach(async function () {
1361+
// explicitly remove the fail point to prevent interaction betweet test runs
13511362
await utilClient.db().admin().command({
13521363
configureFailPoint: 'failCommand',
13531364
mode: 'off'
@@ -1419,6 +1430,7 @@ describe('OIDC Auth Spec Tests', function () {
14191430
});
14201431

14211432
afterEach(async function () {
1433+
// explicitly remove the fail point to prevent interaction betweet test runs
14221434
await utilClient.db().admin().command({
14231435
configureFailPoint: 'failCommand',
14241436
mode: 'off'
@@ -1496,6 +1508,7 @@ describe('OIDC Auth Spec Tests', function () {
14961508
});
14971509

14981510
afterEach(async function () {
1511+
// explicitly remove the fail point to prevent interaction betweet test runs
14991512
await utilClient.db().admin().command({
15001513
configureFailPoint: 'failCommand',
15011514
mode: 'off'
@@ -1581,6 +1594,7 @@ describe('OIDC Auth Spec Tests', function () {
15811594
});
15821595

15831596
afterEach(async function () {
1597+
// explicitly remove the fail point to prevent interaction betweet test runs
15841598
await utilClient.db().admin().command({
15851599
configureFailPoint: 'failCommand',
15861600
mode: 'off'

test/tools/unified-spec-runner/entities.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,14 @@ export class UnifiedMongoClient extends MongoClient {
265265
};
266266
}
267267

268+
const appNameNonce = Math.random().toString(16).slice(2);
269+
if (description.uriOptions && description.uriOptions.appName) {
270+
options.appName = description.uriOptions.appName + '-' + appNameNonce;
271+
} else {
272+
options.appName = `unified-spec-runner-${appNameNonce}`;
273+
}
274+
console.log(`Client options appName: ${options.appName}`); // TODO: remove before merging
275+
268276
super(uri, options);
269277
this.observedEventEmitter.on('error', () => null);
270278
this.logCollector = logCollector;
@@ -621,8 +629,10 @@ export class EntitiesMap<E = Entity> extends Map<string, E> {
621629
} else {
622630
uri = makeConnectionString(config.url({ useMultipleMongoses }), entity.client.uriOptions);
623631
}
632+
console.log(`Client connection string ${uri}`); // TODO: remove before merging
624633

625634
const client = new UnifiedMongoClient(uri, entity.client, config);
635+
console.log(`Client options appName: ${client.options.appName}`); // TODO: remove before merging
626636
try {
627637
new EntityEventRegistry(client, entity.client, map).register();
628638
await client.connect();

0 commit comments

Comments
 (0)