@@ -14,7 +14,8 @@ import {
14
14
clearFailPoint ,
15
15
configureFailPoint ,
16
16
makeMultiBatchWrite ,
17
- makeMultiResponseBatchModelArray
17
+ makeMultiResponseBatchModelArray ,
18
+ waitUntilPoolsFilled
18
19
} from '../../tools/utils' ;
19
20
import { filterForCommands } from '../shared' ;
20
21
@@ -266,7 +267,7 @@ describe('Client Bulk Write', function () {
266
267
const commands : CommandStartedEvent [ ] = [ ] ;
267
268
268
269
beforeEach ( async function ( ) {
269
- client = this . configuration . newClient ( { } , { monitorCommands : true } ) ;
270
+ client = this . configuration . newClient ( { } , { monitorCommands : true , minPoolSize : 5 } ) ;
270
271
client . on ( 'commandStarted' , filterForCommands ( [ 'getMore' ] , commands ) ) ;
271
272
await client . connect ( ) ;
272
273
@@ -291,7 +292,9 @@ describe('Client Bulk Write', function () {
291
292
expect ( timeoutError ) . to . be . instanceOf ( MongoOperationTimeoutError ) ;
292
293
293
294
// 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 ) ;
295
298
expect ( commands ) . to . have . lengthOf ( 1 ) ;
296
299
} ) ;
297
300
} ) ;
0 commit comments