hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lium...@apache.org
Subject hadoop git commit: HDFS-10921. TestDiskspaceQuotaUpdate doesn't wait for NN to get out of safe mode. Contributed by Eric Badger
Date Wed, 26 Oct 2016 21:17:47 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 0c96ceaca -> 2aed61d88


HDFS-10921. TestDiskspaceQuotaUpdate doesn't wait for NN to get out of safe mode. Contributed
by Eric Badger

(cherry picked from commit 55e1fb8e3221941321e6f5e04b334246c5f23027)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/2aed61d8
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/2aed61d8
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/2aed61d8

Branch: refs/heads/branch-2
Commit: 2aed61d88785433eee99fadef85b081600a651b1
Parents: 0c96cea
Author: Mingliang Liu <liuml07@apache.org>
Authored: Wed Oct 26 14:11:05 2016 -0700
Committer: Mingliang Liu <liuml07@apache.org>
Committed: Wed Oct 26 14:12:08 2016 -0700

----------------------------------------------------------------------
 .../namenode/TestDiskspaceQuotaUpdate.java       | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/2aed61d8/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestDiskspaceQuotaUpdate.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestDiskspaceQuotaUpdate.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestDiskspaceQuotaUpdate.java
index 4b0ac08..bb793fe 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestDiskspaceQuotaUpdate.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestDiskspaceQuotaUpdate.java
@@ -52,6 +52,7 @@ import org.apache.hadoop.test.GenericTestUtils;
 import org.apache.hadoop.test.GenericTestUtils.LogCapturer;
 import org.junit.AfterClass;
 import org.junit.Assert;
+import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.mockito.Mockito;
@@ -76,6 +77,18 @@ public class TestDiskspaceQuotaUpdate {
     cluster.waitActive();
   }
 
+  @Before
+  public void resetCluster() throws Exception {
+    if (!cluster.isClusterUp()) {
+      // Previous test seems to have left cluster in a bad state;
+      // recreate the cluster to protect subsequent tests
+      cluster.shutdown();
+      cluster = new MiniDFSCluster.Builder(conf).numDataNodes(REPLICATION)
+        .build();
+      cluster.waitActive();
+    }
+  }
+
   @AfterClass
   public static void tearDown() throws Exception {
     if (cluster != null) {
@@ -254,7 +267,7 @@ public class TestDiskspaceQuotaUpdate {
     assertEquals(spaceUsed, newSpaceUsed);
     // make sure edits aren't corrupted
     getDFS().recoverLease(file);
-    cluster.restartNameNodes();
+    cluster.restartNameNode(true);
   }
 
   /**
@@ -297,7 +310,7 @@ public class TestDiskspaceQuotaUpdate {
     assertEquals(spaceUsed, newSpaceUsed);
     // make sure edits aren't corrupted
     getDFS().recoverLease(file);
-    cluster.restartNameNodes();
+    cluster.restartNameNode(true);
   }
 
   /**
@@ -337,7 +350,7 @@ public class TestDiskspaceQuotaUpdate {
     assertEquals(spaceUsed, newSpaceUsed);
     // make sure edits aren't corrupted
     getDFS().recoverLease(file);
-    cluster.restartNameNodes();
+    cluster.restartNameNode(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