LUCENE-9359: Address test failures when the codec version gets modified.

This commit is contained in:
Adrien Grand 2020-05-29 21:16:10 +02:00
parent f908f2cd48
commit 22cb4d4d95
1 changed files with 4 additions and 1 deletions

View File

@ -31,6 +31,7 @@ import org.apache.lucene.util.TestUtil;
import org.apache.lucene.util.Version;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@ -235,7 +236,9 @@ public class TestSegmentInfos extends LuceneTestCase {
}
assertTrue("No segments file found", corrupt);
expectThrows(CorruptIndexException.class, () -> SegmentInfos.readLatestCommit(corruptDir));
expectThrowsAnyOf(
Arrays.asList(CorruptIndexException.class, IndexFormatTooOldException.class, IndexFormatTooNewException.class),
() -> SegmentInfos.readLatestCommit(corruptDir));
dir.close();
corruptDir.close();
}