Skip to content

Commit f11de93

Browse files
filter by ns
remove stray only
1 parent f53ecc6 commit f11de93

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

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

+7-7
Original file line numberDiff line numberDiff line change
@@ -716,13 +716,13 @@ describe('MongoClient.close() Integration', () => {
716716
utilClient = this.configuration.newClient();
717717
await client.connect();
718718
await client
719-
.db('db')
720-
.collection('coll')
719+
.db('close')
720+
.collection('cursorCleanUp')
721721
?.drop()
722722
.catch(() => null);
723723
coll = await client
724-
.db('db')
725-
.createCollection('coll', { capped: true, size: 1_000, max: 4 });
724+
.db('close')
725+
.createCollection('cursorCleanUp', { capped: true, size: 1_000, max: 4 });
726726
await coll.insertMany([{ a: 1 }, { b: 2 }, { c: 3 }]);
727727
});
728728

@@ -745,9 +745,9 @@ describe('MongoClient.close() Integration', () => {
745745
cursor: {},
746746
pipeline: [{ $currentOp: { idleCursors: true } }]
747747
});
748-
return res.cursor.firstBatch.filter(
749-
r => r.type === 'idleCursor' || (r.type === 'op' && r.desc === 'getMore')
750-
);
748+
const isCursor = r =>
749+
r.type === 'idleCursor' || (r.type === 'op' && r.desc === 'getMore');
750+
return res.cursor.firstBatch.filter(r => isCursor(r) && r.ns === 'close.cursorCleanUp');
751751
};
752752

753753
cursor = coll.find(

0 commit comments

Comments
 (0)