hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From inigo...@apache.org
Subject [4/5] hadoop git commit: HDFS-13681. Fix TestStartup.testNNFailToStartOnReadOnlyNNDir test failure on Windows. Contributed by Xiao Liang.
Date Fri, 15 Jun 2018 23:52:05 GMT
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/9e148aa0
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/9e148aa0
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/9e148aa0

Branch: refs/heads/branch-2
Commit: 9e148aa0bc387a098785a8dddbbce23480aa5eb9
Parents: b52316d
Author: Inigo Goiri <inigoiri@apache.org>
Authored: Fri Jun 15 16:49:06 2018 -0700
Committer: Inigo Goiri <inigoiri@apache.org>
Committed: Fri Jun 15 16:51:03 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/9e148aa0/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 f8a0336..5d58658 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
@@ -689,8 +689,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());
@@ -699,7 +699,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) {
@@ -711,7 +711,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


Mime
View raw message