@@ -8,6 +8,7 @@ import { setTimeout } from 'timers';
8
8
9
9
import {
10
10
type ChangeStream ,
11
+ type ChangeStreamDocument ,
11
12
type ChangeStreamOptions ,
12
13
type Collection ,
13
14
type CommandStartedEvent ,
@@ -1955,7 +1956,9 @@ describe('ChangeStream resumability', function () {
1955
1956
1956
1957
expect ( change ) . to . have . property ( 'operationType' , 'insert' ) ;
1957
1958
1958
- expect ( aggregateEvents ) . to . have . lengthOf ( 6 ) ;
1959
+ // More than one aggregate event indicates that the change stream attempted more than one
1960
+ // resume attempt.
1961
+ expect ( aggregateEvents . length ) . to . be . greaterThan ( 1 ) ;
1959
1962
}
1960
1963
) ;
1961
1964
}
@@ -2147,7 +2150,9 @@ describe('ChangeStream resumability', function () {
2147
2150
2148
2151
expect ( change ) . to . be . true ;
2149
2152
2150
- expect ( aggregateEvents ) . to . have . lengthOf ( 6 ) ;
2153
+ // More than one aggregate event indicates that the change stream attempted more than one
2154
+ // resume attempt.
2155
+ expect ( aggregateEvents . length ) . to . be . greaterThan ( 1 ) ;
2151
2156
}
2152
2157
) ;
2153
2158
}
@@ -2346,7 +2351,9 @@ describe('ChangeStream resumability', function () {
2346
2351
expect . fail ( `expected tryNext to resume, received error instead: ${ err } ` ) ;
2347
2352
}
2348
2353
2349
- expect ( aggregateEvents ) . to . have . lengthOf ( 6 ) ;
2354
+ // More than one aggregate event indicates that the change stream attempted more than one
2355
+ // resume attempt.
2356
+ expect ( aggregateEvents . length ) . to . be . greaterThan ( 1 ) ;
2350
2357
}
2351
2358
) ;
2352
2359
}
@@ -2732,7 +2739,9 @@ describe('ChangeStream resumability', function () {
2732
2739
const [ change ] = ( value as PromiseFulfilledResult < ChangeStreamDocument [ ] > ) . value ;
2733
2740
expect ( change ) . to . have . property ( 'operationType' , 'insert' ) ;
2734
2741
2735
- expect ( aggregateEvents ) . to . have . lengthOf ( 6 ) ;
2742
+ // More than one aggregate event indicates that the change stream attempted more than one
2743
+ // resume attempt.
2744
+ expect ( aggregateEvents . length ) . to . be . greaterThan ( 1 ) ;
2736
2745
}
2737
2746
) ;
2738
2747
}
0 commit comments