@@ -14,7 +14,8 @@ import {
1414 clearFailPoint ,
1515 configureFailPoint ,
1616 makeMultiBatchWrite ,
17- makeMultiResponseBatchModelArray
17+ makeMultiResponseBatchModelArray ,
18+ waitUntilPoolsFilled
1819} from '../../tools/utils' ;
1920import { filterForCommands } from '../shared' ;
2021
@@ -266,7 +267,7 @@ describe('Client Bulk Write', function () {
266267 const commands : CommandStartedEvent [ ] = [ ] ;
267268
268269 beforeEach ( async function ( ) {
269- client = this . configuration . newClient ( { } , { monitorCommands : true } ) ;
270+ client = this . configuration . newClient ( { } , { monitorCommands : true , minPoolSize : 5 } ) ;
270271 client . on ( 'commandStarted' , filterForCommands ( [ 'getMore' ] , commands ) ) ;
271272 await client . connect ( ) ;
272273
@@ -291,7 +292,9 @@ describe('Client Bulk Write', function () {
291292 expect ( timeoutError ) . to . be . instanceOf ( MongoOperationTimeoutError ) ;
292293
293294 // DRIVERS-3005 - killCursors causes cursor cleanup to extend past timeoutMS.
294- expect ( end - start ) . to . be . within ( 2000 - 100 , 2000 + 100 ) ;
295+ // The amount of time killCursors takes is wildly variable and can take up to almost
296+ // 500ms sometimes.
297+ expect ( end - start ) . to . be . within ( 1500 , 1500 + 600 ) ;
295298 expect ( commands ) . to . have . lengthOf ( 1 ) ;
296299 } ) ;
297300 } ) ;
0 commit comments