hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [2/3] hadoop git commit: Revert "HDFS-10668. Fix intermittently failing UT TestDataNodeMXBean#testDataNodeMXBeanBlockCount. Contributed by Mingliang Liu."
Date Tue, 26 Jul 2016 13:31:28 GMT
Revert "HDFS-10668. Fix intermittently failing UT TestDataNodeMXBean#testDataNodeMXBeanBlockCount.
Contributed by Mingliang Liu."

This reverts commit b3ce778268a441b742b625594d1a55b83960f355.


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

Branch: refs/heads/branch-2
Commit: e5a4b6cb946e04ae5b6beb233b1c82d235fc526c
Parents: f4207d0
Author: Steve Loughran <stevel@apache.org>
Authored: Tue Jul 26 14:30:31 2016 +0100
Committer: Steve Loughran <stevel@apache.org>
Committed: Tue Jul 26 14:30:31 2016 +0100

----------------------------------------------------------------------
 .../server/datanode/TestDataNodeMXBean.java     | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/e5a4b6cb/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeMXBean.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeMXBean.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeMXBean.java
index 8481ea5..24fe336 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeMXBean.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeMXBean.java
@@ -25,13 +25,11 @@ import java.util.Map;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 
-import com.google.common.base.Supplier;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hdfs.DFSTestUtil;
 import org.apache.hadoop.hdfs.MiniDFSCluster;
-import org.apache.hadoop.test.GenericTestUtils;
 import org.junit.Assert;
 import org.junit.Test;
 import org.mortbay.util.ajax.JSON;
@@ -115,18 +113,10 @@ public class TestDataNodeMXBean {
       cluster.waitActive();
       assertEquals("After restart DN", 5, getTotalNumBlocks(mbs, mxbeanName));
       fs.delete(new Path("/tmp.txt1"), true);
-      // The total numBlocks should be updated after one file is deleted
-      GenericTestUtils.waitFor(new Supplier<Boolean>() {
-        @Override
-        public Boolean get() {
-          try {
-            return getTotalNumBlocks(mbs, mxbeanName) == 4;
-          } catch (Exception e) {
-            e.printStackTrace();
-            return false;
-          }
-        }
-      }, 100, 30000);
+      // Wait till replica gets deleted on disk.
+      Thread.sleep(5000);
+      assertEquals("After delete one file", 4,
+              getTotalNumBlocks(mbs, mxbeanName));
     } finally {
       if (cluster != null) {
         cluster.shutdown();
@@ -135,7 +125,7 @@ public class TestDataNodeMXBean {
   }
 
   @SuppressWarnings("unchecked")
-  private int getTotalNumBlocks(MBeanServer mbs, ObjectName mxbeanName)
+  int getTotalNumBlocks(MBeanServer mbs, ObjectName mxbeanName)
           throws Exception {
     int totalBlocks = 0;
     String volumeInfo = (String) mbs.getAttribute(mxbeanName, "VolumeInfo");


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