hadoop-common-commits mailing list archives

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

Branch: refs/heads/branch-3.0
Commit: 11d3db2dba0e5591634e0ae337ad9276edf04e08
Parents: 69abd1f
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:50:20 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/11d3db2d/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


Mime
View raw message