You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by so...@apache.org on 2020/06/03 19:14:09 UTC
[lucene-solr] 40/47: LUCENE-9359: Address test failures when the
codec version gets modified.
This is an automated email from the ASF dual-hosted git repository.
sokolov pushed a commit to branch jira/lucene-8962
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
commit 793c1a1c8899fc503770009a3a65caf04d6d1872
Author: Adrien Grand <jp...@gmail.com>
AuthorDate: Fri May 29 21:16:10 2020 +0200
LUCENE-9359: Address test failures when the codec version gets modified.
---
lucene/core/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 23c98ad..1d6a4f4 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();
}