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