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:17 UTC

[lucene] branch main 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 main
in repository https://gitbox.apache.org/repos/asf/lucene.git


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

commit 8710252116b860c663950ca5162989bb5cd07b61
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 a1e209c..ae86a45 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;
@@ -1655,8 +1656,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);
+            }
           }
         }