jpountz commented on a change in pull request #1834:
URL: https://github.com/apache/lucene-solr/pull/1834#discussion_r483967822



##########
File path: 
lucene/test-framework/src/java/org/apache/lucene/search/AssertingWeight.java
##########
@@ -85,11 +85,18 @@ public long cost() {
 
   @Override
   public BulkScorer bulkScorer(LeafReaderContext context) throws IOException {
-    BulkScorer inScorer = in.bulkScorer(context);
+    BulkScorer inScorer;
+    // We explicitly test both the delegate's bulk scorer, and also the normal 
scorer.
+    // This ensures that normal scorers are sometimes tested with an asserting 
wrapper.
+    if (random.nextBoolean()) {
+      inScorer = in.bulkScorer(context);
+    } else {
+      inScorer = super.bulkScorer(context);
+    }

Review comment:
       I know of several tests that test first with a top-level query and then 
with a filter to make sure that both the bulk scorer and the scorer are tested. 
With this change, 50% of the time, we wouldn't be testing the bulk scorer, so I 
wonder if we should replace `random.nextBoolean()` with `frequently()` or 
something like that.




----------------------------------------------------------------
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.

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