You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jp...@apache.org on 2020/05/29 21:16:45 UTC

[lucene-solr] branch branch_8x updated: LUCENE-9359: Address test failures when the codec version gets modified.

This is an automated email from the ASF dual-hosted git repository.

jpountz pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/branch_8x by this push:
     new ec1757b  LUCENE-9359: Address test failures when the codec version gets modified.
ec1757b is described below

commit ec1757b7c21bf023b31853aabe2f4f4d2a46c18e
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 69cf1b1..e842cd7 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.LinkedHashMap;
@@ -241,7 +242,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();
   }