You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by in...@apache.org on 2018/06/15 23:52:03 UTC
[2/5] hadoop git commit: HDFS-13681. Fix
TestStartup.testNNFailToStartOnReadOnlyNNDir test failure on Windows.
Contributed by Xiao Liang.
HDFS-13681. Fix TestStartup.testNNFailToStartOnReadOnlyNNDir test failure on Windows. Contributed by Xiao Liang.
(cherry picked from commit 8762e9cf10fa100dd5f7fd695f5e52b75a94c5d4)
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/88e8a3e5
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/88e8a3e5
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/88e8a3e5
Branch: refs/heads/branch-3.1
Commit: 88e8a3e5bcd035ba7651f1278b0bcfa39ad8d463
Parents: 7c06be3
Author: Inigo Goiri <in...@apache.org>
Authored: Fri Jun 15 16:49:06 2018 -0700
Committer: Inigo Goiri <in...@apache.org>
Committed: Fri Jun 15 16:49:51 2018 -0700
----------------------------------------------------------------------
.../org/apache/hadoop/hdfs/server/namenode/TestStartup.java | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/88e8a3e5/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestStartup.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestStartup.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestStartup.java
index d5f5487..2401608 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestStartup.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestStartup.java
@@ -728,8 +728,8 @@ public class TestStartup {
assertTrue(nnDirs.iterator().hasNext());
assertEquals(
"NN dir should be created after NN startup.",
- nnDirStr,
- nnDirs.iterator().next().getPath());
+ new File(nnDirStr),
+ new File(nnDirs.iterator().next().getPath()));
final File nnDir = new File(nnDirStr);
assertTrue(nnDir.exists());
assertTrue(nnDir.isDirectory());
@@ -738,7 +738,7 @@ public class TestStartup {
/* set read only */
assertTrue(
"Setting NN dir read only should succeed.",
- nnDir.setReadOnly());
+ FileUtil.setWritable(nnDir, false));
cluster.restartNameNodes();
fail("Restarting NN should fail on read only NN dir.");
} catch (InconsistentFSStateException e) {
@@ -750,7 +750,8 @@ public class TestStartup {
"storage directory does not exist or is not accessible."))));
} finally {
/* set back to writable in order to clean it */
- assertTrue("Setting NN dir should succeed.", nnDir.setWritable(true));
+ assertTrue("Setting NN dir should succeed.",
+ FileUtil.setWritable(nnDir, true));
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org