hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From epa...@apache.org
Subject hadoop git commit: HDFS-11316. TestDataNodeVolumeFailure#testUnderReplicationAfterVolFailure fails in trunk. Contributed by Yiqun Lin.
Date Wed, 19 Apr 2017 17:18:01 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 5225ae50b -> e278eb3ab


HDFS-11316. TestDataNodeVolumeFailure#testUnderReplicationAfterVolFailure fails in trunk.
Contributed by Yiqun Lin.

(cherry picked from commit 724bb8635144dd16fc18cf95a78db6c3d5d1c468)


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

Branch: refs/heads/branch-2
Commit: e278eb3ab51d8e814755137c13503afcef677381
Parents: 5225ae5
Author: Yiqun Lin <yqlin@apache.org>
Authored: Thu Jan 19 12:05:13 2017 +0800
Committer: Eric Payne <epayne@apache.org>
Committed: Wed Apr 19 12:15:52 2017 -0500

----------------------------------------------------------------------
 .../datanode/TestDataNodeVolumeFailure.java     | 22 ++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/e278eb3a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeVolumeFailure.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeVolumeFailure.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeVolumeFailure.java
index e134bcc..216ecaf 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeVolumeFailure.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeVolumeFailure.java
@@ -417,12 +417,22 @@ public class TestDataNodeVolumeFailure {
     DFSTestUtil.createFile(fs, file2, 1024, (short)3, 1L);
     DFSTestUtil.waitReplication(fs, file2, (short)3);
 
-    // underReplicatedBlocks are due to failed volumes
-    int underReplicatedBlocks =
-        BlockManagerTestUtil.checkHeartbeatAndGetUnderReplicatedBlocksCount(
-            cluster.getNamesystem(), bm);
-    assertTrue("There is no under replicated block after volume failure",
-        underReplicatedBlocks > 0);
+    GenericTestUtils.waitFor(new Supplier<Boolean>() {
+      @Override
+      public Boolean get() {
+        // underReplicatedBlocks are due to failed volumes
+        int underReplicatedBlocks = BlockManagerTestUtil
+            .checkHeartbeatAndGetUnderReplicatedBlocksCount(
+                cluster.getNamesystem(), bm);
+
+        if (underReplicatedBlocks > 0) {
+          return true;
+        }
+        LOG.info("There is no under replicated block after volume failure.");
+
+        return false;
+      }
+    }, 500, 60000);
   }
 
   /**


---------------------------------------------------------------------
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