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



##########
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:
       That makes sense to me, I can reduce the frequency with which we take 
the `Scorer` path.
   
   I didn't know about the practice of testing both with a top-level query and 
a filter. To me this change is still valuable, it ensures we check the scorer/ 
iterator contract sometimes in a clear + solid way.




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