Skip to content

Commit b55b26a

Browse files
committed
fix tests
1 parent 9a5204b commit b55b26a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

qa/evil-tests/src/test/java/org/elasticsearch/env/NodeEnvironmentEvilTests.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,19 @@ public void testMissingWritePermission() throws IOException {
5151
Settings build = Settings.builder()
5252
.put(Environment.PATH_HOME_SETTING.getKey(), createTempDir().toAbsolutePath().toString())
5353
.putList(Environment.PATH_DATA_SETTING.getKey(), tempPaths).build();
54-
IOException exception = expectThrows(IOException.class, () -> {
54+
IllegalStateException exception = expectThrows(IllegalStateException.class, () -> {
5555
new NodeEnvironment(build, TestEnvironment.newEnvironment(build));
5656
});
57-
assertTrue(exception.getMessage(), exception.getMessage().startsWith(path.toString()));
57+
assertTrue(exception.getCause().getCause().getMessage(),
58+
exception.getCause().getCause().getMessage().startsWith(path.toString()));
5859
}
5960
}
6061

6162
public void testMissingWritePermissionOnIndex() throws IOException {
6263
assumeTrue("posix filesystem", isPosix);
6364
final String[] tempPaths = tmpPaths();
6465
Path path = PathUtils.get(randomFrom(tempPaths));
65-
Path fooIndex = path.resolve("nodes").resolve("0").resolve(NodeEnvironment.INDICES_FOLDER)
66+
Path fooIndex = path.resolve(NodeEnvironment.INDICES_FOLDER)
6667
.resolve("foo");
6768
Files.createDirectories(fooIndex);
6869
try (PosixPermissionsResetter attr = new PosixPermissionsResetter(fooIndex)) {
@@ -82,7 +83,7 @@ public void testMissingWritePermissionOnShard() throws IOException {
8283
assumeTrue("posix filesystem", isPosix);
8384
final String[] tempPaths = tmpPaths();
8485
Path path = PathUtils.get(randomFrom(tempPaths));
85-
Path fooIndex = path.resolve("nodes").resolve("0").resolve(NodeEnvironment.INDICES_FOLDER)
86+
Path fooIndex = path.resolve(NodeEnvironment.INDICES_FOLDER)
8687
.resolve("foo");
8788
Path fooShard = fooIndex.resolve("0");
8889
Path fooShardIndex = fooShard.resolve("index");

0 commit comments

Comments
 (0)