File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -1848,7 +1848,7 @@ describe('Cursor', function () {
1848
1848
}
1849
1849
} ) ;
1850
1850
1851
- it ( 'closes cursors when client is closed even if it has not been exhausted' , async function ( ) {
1851
+ it . only ( 'closes cursors when client is closed even if it has not been exhausted' , async function ( ) {
1852
1852
await client
1853
1853
. db ( )
1854
1854
. dropCollection ( 'test_cleanup_tailable' )
@@ -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