Skip to content

Commit 145c987

Browse files
txn test fix 2
1 parent 80b87e0 commit 145c987

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ describe('MongoClient.close() Integration', () => {
427427
const metadata: MongoDBMetadataUI = { requires: { topology: 'sharded' } };
428428

429429
describe('after SRVPoller is created', () => {
430-
it.skip('timers are cleaned up by client.close()', metadata, async () => {
430+
it('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`;
433433
// 27018 localhost.test.build.10gen.cc.
@@ -455,14 +455,19 @@ describe('MongoClient.close() Integration', () => {
455455
let utilClient;
456456
let session;
457457

458-
const metadata: MongoDBMetadataUI = { requires: { topology: ['replicaset', 'sharded'] } };
458+
const metadata: MongoDBMetadataUI = {
459+
requires: {
460+
topology: ['replicaset', 'sharded'],
461+
mongodb: '>=5.0' // currentOp requires 5.0 and above
462+
}
463+
};
459464

460465
beforeEach(async function () {
461466
client = this.configuration.newClient();
462467
utilClient = this.configuration.newClient();
463468
await client.connect();
464-
session = client.startSession({ explicit: false });
465469
const collection = client.db('db').collection('collection');
470+
session = client.startSession({ explicit: false });
466471
session.startTransaction();
467472
await collection.insertOne({ x: 1 }, { session });
468473

@@ -523,8 +528,8 @@ describe('MongoClient.close() Integration', () => {
523528
client = this.configuration.newClient();
524529
utilClient = this.configuration.newClient();
525530
await client.connect();
526-
session = client.startSession();
527531
const collection = client.db('db').collection('collection');
532+
session = client.startSession();
528533
session.startTransaction();
529534
await collection.insertOne({ x: 1 }, { session });
530535

@@ -693,7 +698,7 @@ describe('MongoClient.close() Integration', () => {
693698
await cursor?.close();
694699
});
695700

696-
it('all active server-side cursors are closed by client.close()', async function () {
701+
it.skip('all active server-side cursors are closed by client.close()', async function () {
697702
const getCursors = async () => {
698703
const res = await utilClient
699704
.db()

0 commit comments

Comments
 (0)