diff --git a/src/test/java/org/elasticsearch/bwcompat/StaticIndexBackwardCompatibilityTest.java b/src/test/java/org/elasticsearch/bwcompat/StaticIndexBackwardCompatibilityTest.java index 1b0718038bf..011ce7a7459 100644 --- a/src/test/java/org/elasticsearch/bwcompat/StaticIndexBackwardCompatibilityTest.java +++ b/src/test/java/org/elasticsearch/bwcompat/StaticIndexBackwardCompatibilityTest.java @@ -39,7 +39,7 @@ public class StaticIndexBackwardCompatibilityTest extends ElasticsearchIntegrati public void loadIndex(String index, Object... settings) throws Exception { logger.info("Checking static index " + index); - Settings nodeSettings = prepareBackwardsDataDir(Paths.get(getClass().getResource(index + ".zip").toURI()), settings); + Settings nodeSettings = prepareBackwardsDataDir(getDataPath(index + ".zip"), settings); internalCluster().startNode(nodeSettings); ensureGreen(index); assertIndexSanity(index); diff --git a/src/test/java/org/elasticsearch/test/ElasticsearchIntegrationTest.java b/src/test/java/org/elasticsearch/test/ElasticsearchIntegrationTest.java index 2793db1b043..80442497217 100644 --- a/src/test/java/org/elasticsearch/test/ElasticsearchIntegrationTest.java +++ b/src/test/java/org/elasticsearch/test/ElasticsearchIntegrationTest.java @@ -76,7 +76,6 @@ import org.elasticsearch.common.Priority; import org.elasticsearch.common.Strings; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.collect.Tuple; -import org.elasticsearch.common.io.FileSystemUtils; import org.elasticsearch.common.io.PathUtils; import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.settings.ImmutableSettings; @@ -99,7 +98,6 @@ import org.elasticsearch.index.fielddata.FieldDataType; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.FieldMapper; import org.elasticsearch.index.mapper.FieldMapper.Loading; -import org.elasticsearch.index.mapper.internal.AllFieldMapper; import org.elasticsearch.index.mapper.internal.SizeFieldMapper; import org.elasticsearch.index.mapper.internal.SourceFieldMapper; import org.elasticsearch.index.mapper.internal.TimestampFieldMapper; @@ -148,7 +146,6 @@ import java.net.InetSocketAddress; import java.nio.file.DirectoryStream; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -1925,7 +1922,19 @@ public abstract class ElasticsearchIntegrationTest extends ElasticsearchTestCase TestUtil.unzip(stream, indexDir); } assertTrue(Files.exists(dataDir)); - Path[] list = FileSystemUtils.files(dataDir); + + // list clusters in the datapath, ignoring anything from extrasfs + final Path[] list; + try (DirectoryStream stream = Files.newDirectoryStream(dataDir)) { + List dirs = new ArrayList<>(); + for (Path p : stream) { + if (!p.getFileName().toString().startsWith("extra")) { + dirs.add(p); + } + } + list = dirs.toArray(new Path[0]); + } + if (list.length != 1) { throw new IllegalStateException("Backwards index must contain exactly one cluster\n" + StringUtils.join(list, "\n")); }