Skip to content

Commit

Permalink
Fix incorrect assertions in CollapsingTopDocsCollectorSearchAfterTests
Browse files Browse the repository at this point in the history
These assertions were simply wrong, but took time to catch as they were very
rarely triggered.

Fixes #75736.
  • Loading branch information
jtibshirani committed Jul 28, 2021
1 parent 8082bbb commit 02c9e2a
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,11 @@ private <T extends Comparable<T>> void assertSearchCollapse(CollapsingDocValuesP
currentValue = fieldDoc.fields[0];
}

if (docsWithMissingField == false) {
assertEquals(expectedNumGroups, collapseTopFieldDocs.scoreDocs.length - 1);
assertEquals(topDocs.scoreDocs.length - 1, topDocsIndex);
for (; topDocsIndex < topDocs.scoreDocs.length; topDocsIndex++) {
FieldDoc fieldDoc = (FieldDoc) topDocs.scoreDocs[topDocsIndex];
assertEquals(fieldDoc.fields[0], currentValue);
}

w.close();
reader.close();
dir.close();
Expand Down

0 comments on commit 02c9e2a

Please sign in to comment.