Skip to content

Commit

Permalink
Fix TestMatchAllDocsQuery#testEarlyTermination
Browse files Browse the repository at this point in the history
As part of apache#716 I moved the test to use a collector manager, but I forgot to update one of the assertions.
We can't rely on totalHits being accurate when the search is executed my multiple threads and early terminated.
  • Loading branch information
javanna committed Mar 18, 2022
1 parent 1dcb64b commit c8c88f1
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -121,7 +121,7 @@ public void testEarlyTermination() throws IOException {
CollectorManager<TopScoreDocCollector, TopDocs> manager =
TopScoreDocCollector.createSharedManager(10, null, totalHitsThreshold);
TopDocs topDocs = is.search(new MatchAllDocsQuery(), manager);
assertEquals(totalHitsThreshold + 1, topDocs.totalHits.value);
assertTrue(topDocs.totalHits.value > totalHitsThreshold);
assertEquals(TotalHits.Relation.GREATER_THAN_OR_EQUAL_TO, topDocs.totalHits.relation);

manager = TopScoreDocCollector.createSharedManager(10, null, numDocs);
Expand Down

0 comments on commit c8c88f1

Please sign in to comment.