Skip to content

Commit 6629343

Browse files
await collection creation - fix txn test
1 parent 74673f8 commit 6629343

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,10 +470,14 @@ describe('MongoClient.close() Integration', () => {
470470
client = this.configuration.newClient();
471471
utilClient = this.configuration.newClient();
472472
await client.connect();
473-
const collection = client.db('db').collection('collection');
473+
const collection = await client.db('db').createCollection('collection');
474+
console.log('createCollection done');
474475
session = client.startSession({ explicit: false });
476+
console.log('startSession done');
475477
session.startTransaction();
478+
console.log('startTransaction done');
476479
await collection.insertOne({ x: 1 }, { session });
480+
console.log('insert done');
477481

478482
const opBefore = await utilClient.db().admin().command({ currentOp: 1 });
479483
idleSessionsBeforeClose = opBefore.inprog.filter(s => s.type === 'idleSession');
@@ -532,7 +536,7 @@ describe('MongoClient.close() Integration', () => {
532536
client = this.configuration.newClient();
533537
utilClient = this.configuration.newClient();
534538
await client.connect();
535-
const collection = client.db('db').collection('collection');
539+
const collection = await client.db('db').createCollection('collection');
536540
session = client.startSession();
537541
session.startTransaction();
538542
await collection.insertOne({ x: 1 }, { session });

0 commit comments

Comments
 (0)