hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aengin...@apache.org
Subject hadoop git commit: HDFS-11484. Ozone: Fix flaky TestNodeManager#testScmNodeReportUpdate. Contributed by Xiaoyu Yao.
Date Thu, 02 Mar 2017 23:19:35 GMT
Repository: hadoop
Updated Branches:
  refs/heads/HDFS-7240 02c35065f -> e79f9da8d


HDFS-11484. Ozone: Fix flaky TestNodeManager#testScmNodeReportUpdate. Contributed by Xiaoyu
Yao.


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

Branch: refs/heads/HDFS-7240
Commit: e79f9da8de27cb34dd6979d441fdcdd5ed2e8ff9
Parents: 02c3506
Author: Anu Engineer <aengineer@apache.org>
Authored: Thu Mar 2 15:10:47 2017 -0800
Committer: Anu Engineer <aengineer@apache.org>
Committed: Thu Mar 2 15:10:47 2017 -0800

----------------------------------------------------------------------
 .../hadoop/ozone/scm/node/TestNodeManager.java      | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/e79f9da8/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/node/TestNodeManager.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/node/TestNodeManager.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/node/TestNodeManager.java
index 355baed..b6acfd1 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/node/TestNodeManager.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/node/TestNodeManager.java
@@ -970,13 +970,14 @@ public class TestNodeManager {
         Thread.sleep(100);
       }
 
-      GenericTestUtils.waitFor(() -> nodeManager.waitForHeartbeatThead(), 100,
-          4 * 1000);
-      assertEquals(nodeCount, nodeManager.getNodeCount(HEALTHY));
-
       final long expectedScmUsed = usedPerHeartbeat * (heartbeatCount -1);
       final long expectedRemaining = capacity -
           usedPerHeartbeat * (heartbeatCount - 1);
+
+      GenericTestUtils.waitFor(
+          () -> nodeManager.getStats().getScmUsed() == expectedScmUsed, 100,
+          4 * 1000);
+
       assertEquals(capacity, nodeManager.getStats().getCapacity());
       assertEquals(expectedScmUsed, nodeManager.getStats().getScmUsed());
       assertEquals(expectedRemaining, nodeManager.getStats().getRemaining());
@@ -1001,11 +1002,11 @@ public class TestNodeManager {
       assertEquals(expectedRemaining,
           nodeManager.getNodeStats().get(0).getRemaining());
 
-      // Wait up to 3 more seconds so the node becomes dead
+      // Wait up to 4 more seconds so the node becomes dead
       // Verify usage info should be updated.
       GenericTestUtils.waitFor(
           () -> nodeManager.getNodeCount(NodeManager.NODESTATE.DEAD) == 1, 100,
-          3 * 1000);
+          4 * 1000);
 
       assertEquals(0, nodeManager.getNodeStats().size());
       assertEquals(0, nodeManager.getStats().getCapacity());
@@ -1026,6 +1027,9 @@ public class TestNodeManager {
       GenericTestUtils.waitFor(
           () -> nodeManager.getNodeCount(NodeManager.NODESTATE.HEALTHY) == 1,
           100, 5 * 1000);
+      GenericTestUtils.waitFor(
+          () -> nodeManager.getStats().getScmUsed() == expectedScmUsed, 100,
+          4 * 1000);
       assertEquals(nodeCount, nodeManager.getNodeStats().size());
       assertEquals(capacity, nodeManager.getNodeStats().get(0).getCapacity());
       assertEquals(expectedScmUsed,


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