mayya-sharipova commented on a change in pull request #331:
URL: https://github.com/apache/lucene/pull/331#discussion_r719487400



##########
File path: 
lucene/test-framework/src/java/org/apache/lucene/search/AssertingBulkScorer.java
##########
@@ -80,8 +80,23 @@ public int score(LeafCollector collector, Bits acceptDocs, 
int min, final int ma
     assert min <= max : "max must be greater than min, got min=" + min + ", 
and max=" + max;
     this.max = max;
     collector = new AssertingLeafCollector(collector, min, max);
-    final int next = in.score(collector, acceptDocs, min, max);
-    assert next >= max;
+    int next = min;
+    do {
+      final int upTo;
+      if (random.nextBoolean()) {
+        upTo = max;
+      } else {
+        final long interval;
+        if (random.nextInt(100) <= 5) {
+          interval = 1 + random.nextInt(10);
+        } else {
+          interval = 1 + random.nextInt(random.nextBoolean() ? 100 : 5000);
+        }
+        upTo = Math.toIntExact(Math.min(next + interval, max));
+      }
+      next = in.score(collector, acceptDocs, next, upTo);

Review comment:
       What is the reason that here we use original `collector` instead of  
each time a new collector with proper ranges: 
`AssertingLeafCollector(collector, next, upTo)`?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to