From 22cb4d4d95ee854aabe5e2a52639f43090fef656 Mon Sep 17 00:00:00 2001 From: Adrien Grand Date: Fri, 29 May 2020 21:16:10 +0200 Subject: [PATCH] LUCENE-9359: Address test failures when the codec version gets modified. --- .../src/test/org/apache/lucene/index/TestSegmentInfos.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSegmentInfos.java b/lucene/core/src/test/org/apache/lucene/index/TestSegmentInfos.java index 23c98ad7acd..1d6a4f44ece 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestSegmentInfos.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestSegmentInfos.java @@ -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(); }