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 () {
1868
1868
// will block for maxAwaitTimeMS (except we are closing the client)
1869
1869
const rejectedEarlyBecauseClientClosed = cursor . next ( ) . catch ( error => error ) ;
1870
1870
1871
+ for (
1872
+ let [ { commandName } ] = await once ( client , 'commandStarted' ) ;
1873
+ commandName !== 'getMore' ;
1874
+ [ { commandName } ] = await once ( client , 'commandStarted' )
1875
+ ) ;
1876
+
1871
1877
await client . close ( ) ;
1872
1878
expect ( cursor ) . to . have . property ( 'closed' , true ) ;
1873
1879
1874
1880
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 ) ;
1880
1882
} ) ;
1881
1883
1882
1884
it ( 'shouldAwaitData' , {
You can’t perform that action at this time.
0 commit comments