File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -1868,15 +1868,17 @@ describe('Cursor', function () {
18681868 // will block for maxAwaitTimeMS (except we are closing the client)
18691869 const rejectedEarlyBecauseClientClosed = cursor . next ( ) . catch ( error => error ) ;
18701870
1871+ for (
1872+ let [ { commandName } ] = await once ( client , 'commandStarted' ) ;
1873+ commandName !== 'getMore' ;
1874+ [ { commandName } ] = await once ( client , 'commandStarted' )
1875+ ) ;
1876+
18711877 await client . close ( ) ;
18721878 expect ( cursor ) . to . have . property ( 'closed' , true ) ;
18731879
18741880 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- }
1881+ expect ( error ) . to . be . instanceOf ( MongoClientClosedError ) ;
18801882 } ) ;
18811883
18821884 it ( 'shouldAwaitData' , {
You can’t perform that action at this time.
0 commit comments