Skip to content

Commit 062c530

Browse files
authored
Fix seed-dependent failure in TestForceNoBulkScoringQuery (#16369)
The sanity check added in #16350 assumes that searching the un-wrapped ThrowsOnBulkScoreQuery always calls ScorerSupplier#bulkScorer. With newSearcher(reader) the searcher may be an AssertingIndexSearcher, whose ScorerSupplier sometimes builds the bulk scorer from scorer() instead of delegating, so the expected AssertionError is never thrown: gradlew -p lucene/monitor test --tests TestForceNoBulkScoringQuery \ -Dtests.seed=BDD18A3ADD885193 Use a plain IndexSearcher so the dispatch under test is deterministic.
1 parent a9eb52b commit 062c530

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lucene/monitor/src/test/org/apache/lucene/monitor/TestForceNoBulkScoringQuery.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@ public void testBulkScoringIsDisabled() throws IOException {
9494
iw.commit();
9595

9696
try (IndexReader reader = DirectoryReader.open(dir)) {
97-
IndexSearcher searcher = newSearcher(reader);
97+
// use a plain searcher: newSearcher may wrap with AssertingIndexSearcher, whose
98+
// ScorerSupplier sometimes builds the bulk scorer from scorer() instead of delegating to
99+
// bulkScorer(), which breaks the sanity check below for some seeds
100+
IndexSearcher searcher = new IndexSearcher(reader);
98101
// disable query caching, so that we exercise the search path directly rather than
99102
// any bulk-scoring optimizations the cache may apply internally
100103
searcher.setQueryCache(null);

0 commit comments

Comments
 (0)