Skip to content

Commit 890d02c

Browse files
committed
test: fix more tests
1 parent aa8a280 commit 890d02c

File tree

2 files changed

+3
-29
lines changed

2 files changed

+3
-29
lines changed

test/integration/node-specific/auto_connect.test.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -842,32 +842,6 @@ describe('When executing an operation for the first time', () => {
842842
});
843843
});
844844

845-
describe(
846-
'when the server requires auth and ping is delayed',
847-
{ requires: { auth: 'enabled', mongodb: '>=4.4' } },
848-
function () {
849-
beforeEach(async function () {
850-
// set failpoint to delay ping
851-
// create new util client to avoid affecting the test client
852-
const utilClient = this.configuration.newClient();
853-
await utilClient.db('admin').command({
854-
configureFailPoint: 'failCommand',
855-
mode: { times: 1 },
856-
data: { failCommands: ['ping'], blockConnection: true, blockTimeMS: 1000 }
857-
} as FailPoint);
858-
await utilClient.close();
859-
});
860-
861-
it('timeoutMS from the client is not used for the internal `ping`', async function () {
862-
const start = performance.now();
863-
const returnedClient = await client.connect();
864-
const end = performance.now();
865-
expect(returnedClient).to.equal(client);
866-
expect(end - start).to.be.within(1000, 1500); // timeoutMS is 1000, did not apply.
867-
});
868-
}
869-
);
870-
871845
describe(
872846
'when server selection takes longer than the timeout',
873847
{ requires: { auth: 'enabled', mongodb: '>=4.4' } },

test/integration/node-specific/mongo_client.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -615,15 +615,15 @@ describe('class MongoClient', function () {
615615
'permits operations to be run after connect is called',
616616
{ requires: { auth: 'enabled' } },
617617
async function () {
618-
const pingCommandToBeStarted = once(client, 'commandStarted');
618+
const checkoutStarted = once(client, 'connectionCheckOutStarted');
619619
await client.connect();
620-
const [pingOnConnect] = await pingCommandToBeStarted;
620+
const checkout = await checkoutStarted;
621+
expect(checkout).to.not.exist;
621622

622623
const findCommandToBeStarted = once(client, 'commandStarted');
623624
await client.db('test').collection('test').findOne();
624625
const [findCommandStarted] = await findCommandToBeStarted;
625626

626-
expect(pingOnConnect).to.have.property('commandName', 'ping');
627627
expect(findCommandStarted).to.have.property('commandName', 'find');
628628
expect(client).to.have.property('topology').that.is.instanceOf(Topology);
629629
}

0 commit comments

Comments
 (0)