Skip to content

Commit 6d1c62f

Browse files
committed
PHPLIB-537: Allow more iterations for change stream spec tests on sharded clusters
1 parent 86e4db1 commit 6d1c62f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/SpecTests/ChangeStreamsSpecTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,13 @@ private function iterateChangeStream(ChangeStream $changeStream, $limit = 0)
263263
* to return as many results as are expected. Require at least one
264264
* iteration to allow next() a chance to throw for error tests. */
265265
$maxIterations = $limit + 1;
266+
267+
/* On sharded clusters, allow for empty getMore calls due to sharding
268+
* architecture */
269+
if ($this->isShardedCluster()) {
270+
$maxIterations *= 5;
271+
}
272+
266273
$events = [];
267274

268275
for ($i = 0, $changeStream->rewind(); $i < $maxIterations; $i++, $changeStream->next()) {

0 commit comments

Comments
 (0)