File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
driver-core/src/test/functional/com/mongodb/internal/operation
driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -477,9 +477,13 @@ class ChangeStreamOperationSpecification extends OperationFunctionalSpecificatio
477
477
when :
478
478
helper. killCursor(helper. getNamespace(), cursor. getWrapped(). getServerCursor())
479
479
expected = insertDocuments(helper, [3 , 4 ])
480
+ def results = nextAndClean(cursor, async)
481
+ if (results. size() < expected. size()) {
482
+ results. addAll(nextAndClean(cursor, async))
483
+ }
480
484
481
485
then :
482
- nextAndClean(cursor, async) == expected
486
+ results == expected
483
487
484
488
then :
485
489
tryNextAndClean(cursor, async) == null
@@ -488,7 +492,7 @@ class ChangeStreamOperationSpecification extends OperationFunctionalSpecificatio
488
492
expected = insertDocuments(helper, [5 , 6 ])
489
493
helper. killCursor(helper. getNamespace(), cursor. getWrapped(). getServerCursor())
490
494
491
- def results = nextAndClean(cursor, async)
495
+ results = nextAndClean(cursor, async)
492
496
if (results. size() < expected. size()) {
493
497
results. addAll(nextAndClean(cursor, async))
494
498
}
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ public Subscription getSubscription() {
166
166
* @throws AssertionError if the sequence of items observed does not exactly match {@code items}
167
167
*/
168
168
public void assertReceivedOnNext (final List <T > items ) {
169
- if (tryMultipleTimes (2 , () -> getOnNextEvents ().size () != items .size ())) {
169
+ if (tryMultipleTimes (items . size () , () -> getOnNextEvents ().size () != items .size ())) {
170
170
throw new AssertionError ("Number of items does not match. Provided: " + items .size () + " Actual: " + getOnNextEvents ().size ());
171
171
}
172
172
You can’t perform that action at this time.
0 commit comments