@@ -5,7 +5,7 @@ import { type Collection, type FindCursor, type MongoClient } from '../../mongod
55import { type TestConfiguration } from '../../tools/runner/config' ;
66import { runScriptAndGetProcessInfo } from './resource_tracking_script_builder' ;
77
8- describe ( 'MongoClient.close() Integration' , ( ) => {
8+ describe . only ( 'MongoClient.close() Integration' , ( ) => {
99 // note: these tests are set-up in accordance of the resource ownership tree
1010
1111 let config : TestConfiguration ;
@@ -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,8 @@ 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 ) => ( ( r . type === 'idleCursor' ) || ( r . type === 'op' && r . desc === 'getMore' ) ) ;
749+ return res . cursor . firstBatch . filter ( r => isCursor ( r ) && r . ns === 'close.cursorCleanUp' ) ;
751750 } ;
752751
753752 cursor = coll . find (
0 commit comments