LUCENE-7574: Fix more index sorting test failures.

This commit is contained in:
Adrien Grand 2016-11-25 16:24:00 +01:00
parent 9b4b120aba
commit d0b5d41f5c
1 changed files with 4 additions and 1 deletions

View File

@ -103,7 +103,10 @@ public class TestIndexSorting extends LuceneTestCase {
return new PointsWriter() {
@Override
public void merge(MergeState mergeState) throws IOException {
assertEquals(needsIndexSort, mergeState.needsIndexSort);
// For single segment merge we cannot infer if the segment is already sorted or not.
if (mergeState.docMaps.length > 1) {
assertEquals(needsIndexSort, mergeState.needsIndexSort);
}
++ numCalls;
writer.merge(mergeState);
}