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 2021/11/25 07:52:14 UTC

[lucene] branch branch_9x updated: Fix test failures with testIndexUpgraderCommandLineArgs and ExtraFS.

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

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


The following commit(s) were added to refs/heads/branch_9x by this push:
     new a97a1e2  Fix test failures with testIndexUpgraderCommandLineArgs and ExtraFS.
a97a1e2 is described below

commit a97a1e2815525270c0714b84e47a1b9675ed8f84
Author: Adrien Grand <jp...@gmail.com>
AuthorDate: Thu Nov 25 08:50:27 2021 +0100

    Fix test failures with testIndexUpgraderCommandLineArgs and ExtraFS.
---
 .../apache/lucene/backward_index/TestBackwardsCompatibility.java   | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBackwardsCompatibility.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBackwardsCompatibility.java
index 54922ad..6712cfc 100644
--- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBackwardsCompatibility.java
+++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBackwardsCompatibility.java
@@ -35,6 +35,7 @@ import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 import java.util.Random;
+import java.util.Set;
 import java.util.TimeZone;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -1677,8 +1678,12 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
             SegmentInfos.readLatestCommit(origDir).getIndexCreatedVersionMajor();
         Path dir = createTempDir(name);
         try (FSDirectory fsDir = FSDirectory.open(dir)) {
+          // beware that ExtraFS might add extraXXX files
+          Set<String> extraFiles = Set.of(fsDir.listAll());
           for (String file : origDir.listAll()) {
-            fsDir.copyFrom(origDir, file, file, IOContext.DEFAULT);
+            if (extraFiles.contains(file) == false) {
+              fsDir.copyFrom(origDir, file, file, IOContext.DEFAULT);
+            }
           }
         }