mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-25 01:19:02 +00:00
* Fix Path comparisons for Windows tests The test NodeEnvironmentTests#testCustonDataPaths worked just fine on Darwin and Linux, but the comparison was breaking in Windows because one path had the "C:\" prefix and the other one didn't. The simple fix is to compare absolute paths rather than potentially relative ones.
This commit is contained in:
parent
aa0c586b73
commit
8c9f15db44
@ -19,7 +19,6 @@
|
||||
package org.elasticsearch.env;
|
||||
|
||||
import org.apache.lucene.index.SegmentInfos;
|
||||
import org.apache.lucene.util.Constants;
|
||||
import org.elasticsearch.common.util.set.Sets;
|
||||
import org.elasticsearch.core.internal.io.IOUtils;
|
||||
import org.apache.lucene.util.LuceneTestCase;
|
||||
@ -390,7 +389,6 @@ public class NodeEnvironmentTests extends ESTestCase {
|
||||
}
|
||||
|
||||
public void testCustomDataPaths() throws Exception {
|
||||
assumeFalse("Fails on Windows, see https://github.com/elastic/elasticsearch/issues/45333", Constants.WINDOWS);
|
||||
String[] dataPaths = tmpPaths();
|
||||
NodeEnvironment env = newNodeEnvironment(dataPaths, "/tmp", Settings.EMPTY);
|
||||
|
||||
@ -406,7 +404,8 @@ public class NodeEnvironmentTests extends ESTestCase {
|
||||
assertTrue("settings with path_data should have a custom data path", s2.hasCustomDataPath());
|
||||
|
||||
assertThat(env.availableShardPaths(sid), equalTo(env.availableShardPaths(sid)));
|
||||
assertThat(env.resolveCustomLocation(s2, sid), equalTo(PathUtils.get("/tmp/foo/0/" + index.getUUID() + "/0")));
|
||||
assertThat(env.resolveCustomLocation(s2, sid).toAbsolutePath(),
|
||||
equalTo(PathUtils.get("/tmp/foo/0/" + index.getUUID() + "/0").toAbsolutePath()));
|
||||
|
||||
assertThat("shard paths with a custom data_path should contain only regular paths",
|
||||
env.availableShardPaths(sid),
|
||||
@ -418,7 +417,8 @@ public class NodeEnvironmentTests extends ESTestCase {
|
||||
IndexSettings s3 = new IndexSettings(s2.getIndexMetaData(), Settings.builder().build());
|
||||
|
||||
assertThat(env.availableShardPaths(sid), equalTo(env.availableShardPaths(sid)));
|
||||
assertThat(env.resolveCustomLocation(s3, sid), equalTo(PathUtils.get("/tmp/foo/0/" + index.getUUID() + "/0")));
|
||||
assertThat(env.resolveCustomLocation(s3, sid).toAbsolutePath(),
|
||||
equalTo(PathUtils.get("/tmp/foo/0/" + index.getUUID() + "/0").toAbsolutePath()));
|
||||
|
||||
assertThat("shard paths with a custom data_path should contain only regular paths",
|
||||
env.availableShardPaths(sid),
|
||||
|
Loading…
x
Reference in New Issue
Block a user