dnhatn commented on a change in pull request #331:
URL: https://github.com/apache/lucene/pull/331#discussion_r719548306



##########
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:
       Sure, we can assert more. I've added it in 
https://github.com/apache/lucene/pull/331/commits/3fcc4570e03950cda4de321d0687d55343c5567e




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to