Skip to content

Commit 689706b

Browse files
test fixes
1 parent e719fa9 commit 689706b

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

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

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,10 +430,14 @@ describe('MongoClient.close() Integration', () => {
430430
it.skip('timers are cleaned up by client.close()', metadata, async () => {
431431
const run = async function ({ MongoClient, expect, getTimerCount }) {
432432
const SRV_CONNECTION_STRING = `mongodb+srv://test1.test.build.10gen.cc`;
433+
433434
// 27018 localhost.test.build.10gen.cc.
434435
// 27017 localhost.test.build.10gen.cc.
435436

436-
const client = new MongoClient(SRV_CONNECTION_STRING);
437+
const client = new MongoClient(SRV_CONNECTION_STRING, {
438+
serverSelectionTimeoutMS: 2000,
439+
tls: false
440+
});
437441
await client.connect();
438442
// the current expected behavior is that _timeout is set to undefined until SRV polling starts
439443
// then _timeout is set to undefined again when SRV polling stops
@@ -689,7 +693,7 @@ describe('MongoClient.close() Integration', () => {
689693
client = this.configuration.newClient();
690694
utilClient = this.configuration.newClient();
691695
await client.connect();
692-
coll = client.db('db').collection('coll');
696+
coll = await client.db('db').createCollection('coll', { capped: true, size: 1_000_000 });
693697
});
694698

695699
afterEach(async function () {
@@ -714,8 +718,13 @@ describe('MongoClient.close() Integration', () => {
714718
};
715719

716720
await coll.insertMany([{ a: 1 }, { b: 2 }, { c: 3 }]);
717-
await coll.insertMany([{ d: 4 }, { e: 5 }, { f: 3 }]);
718-
cursor = await coll.find();
721+
cursor = await coll.find(
722+
{},
723+
{
724+
tailable: true,
725+
awaitData: true
726+
}
727+
);
719728
await cursor.next();
720729

721730
// assert creation

0 commit comments

Comments
 (0)