hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject hbase git commit: HBASE-2004 TestClientClusterStatus is flakey
Date Wed, 21 Feb 2018 22:53:04 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-2 baec532aa -> 92bb4db9e


HBASE-2004 TestClientClusterStatus is flakey


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

Branch: refs/heads/branch-2
Commit: 92bb4db9ef367039029017aafe61c51f2c0181f9
Parents: baec532
Author: Michael Stack <stack@apache.org>
Authored: Wed Feb 21 14:52:10 2018 -0800
Committer: Michael Stack <stack@apache.org>
Committed: Wed Feb 21 14:52:10 2018 -0800

----------------------------------------------------------------------
 .../hadoop/hbase/TestClientClusterStatus.java       | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/92bb4db9/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientClusterStatus.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientClusterStatus.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientClusterStatus.java
index bfdae8a..392ff6e 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientClusterStatus.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientClusterStatus.java
@@ -37,6 +37,7 @@ import org.apache.hadoop.hbase.regionserver.HRegionServer;
 import org.apache.hadoop.hbase.testclassification.MediumTests;
 import org.apache.hadoop.hbase.util.JVMClusterUtil.MasterThread;
 import org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread;
+import org.apache.hadoop.hbase.util.Threads;
 import org.junit.AfterClass;
 import org.junit.Assert;
 import org.junit.BeforeClass;
@@ -100,13 +101,14 @@ public class TestClientClusterStatus {
 
   @Test
   public void testNone() throws Exception {
-    ClusterStatus status0
-      = new ClusterStatus(ADMIN.getClusterMetrics(EnumSet.allOf(Option.class)));
-    ClusterStatus status1
-      = new ClusterStatus(ADMIN.getClusterMetrics(EnumSet.noneOf(Option.class)));
-    Assert.assertEquals(status0, status1);
-    checkPbObjectNotNull(status0);
-    checkPbObjectNotNull(status1);
+    ClusterMetrics status0 = ADMIN.getClusterMetrics(EnumSet.allOf(Option.class));
+    ClusterMetrics status1 = ADMIN.getClusterMetrics(EnumSet.noneOf(Option.class));
+    // Do a rough compare. More specific compares can fail because all regions not deployed
yet
+    // or more requests than expected.
+    Assert.assertEquals(status0.getLiveServerMetrics().size(),
+        status1.getLiveServerMetrics().size());
+    checkPbObjectNotNull(new ClusterStatus(status0));
+    checkPbObjectNotNull(new ClusterStatus(status1));
   }
 
   @Test


Mime
View raw message