File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -1865,18 +1865,22 @@ describe('Cursor', function () {
18651865
18661866 await cursor . next ( ) ;
18671867 await cursor . next ( ) ;
1868+
1869+ const nextCommand = once ( client , 'commandStarted' ) ;
18681870 // will block for maxAwaitTimeMS (except we are closing the client)
18691871 const rejectedEarlyBecauseClientClosed = cursor . next ( ) . catch ( error => error ) ;
18701872
1873+ for (
1874+ let [ { commandName } ] = await nextCommand ;
1875+ commandName !== 'getMore' ;
1876+ [ { commandName } ] = await once ( client , 'commandStarted' )
1877+ ) ;
1878+
18711879 await client . close ( ) ;
18721880 expect ( cursor ) . to . have . property ( 'closed' , true ) ;
18731881
18741882 const error = await rejectedEarlyBecauseClientClosed ;
1875- if ( this . configuration . topologyType === 'LoadBalanced' ) {
1876- expect ( error ) . to . be . instanceOf ( MongoClientClosedError ) ;
1877- } else {
1878- expect ( error ) . to . be . null ;
1879- }
1883+ expect ( error ) . to . be . instanceOf ( MongoClientClosedError ) ;
18801884 } ) ;
18811885
18821886 it ( 'shouldAwaitData' , {
You can’t perform that action at this time.
0 commit comments