HBASE-18634 HBASE-Fix client.TestClientClusterStatus (Chia-Ping Tsai) This is a revert of a revert; i.e. a reapply just to fix commit message.
This reverts commit fbbae8774ca3162245c0d883c9f477f7d92bc8a5. Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/61b2508f Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/61b2508f Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/61b2508f Branch: refs/heads/branch-2 Commit: 61b2508f29c051ca4ca33bd180190b1d5af2087a Parents: 7a16acc Author: Michael Stack <st...@apache.org> Authored: Mon Aug 21 14:38:58 2017 -0700 Committer: Michael Stack <st...@apache.org> Committed: Mon Aug 21 14:40:27 2017 -0700 ---------------------------------------------------------------------- .../hadoop/hbase/client/TestClientClusterStatus.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/61b2508f/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientClusterStatus.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientClusterStatus.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientClusterStatus.java index 49b4ff2..484ee06 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientClusterStatus.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientClusterStatus.java @@ -65,7 +65,7 @@ public class TestClientClusterStatus { RegionServerThread rst = rsts.get(rsts.size() - 1); DEAD = rst.getRegionServer(); DEAD.stop("Test dead servers status"); - while (!DEAD.isStopped()) { + while (rst.isAlive()) { Thread.sleep(500); } } @@ -155,9 +155,11 @@ public class TestClientClusterStatus { Assert.assertNotNull(status); Assert.assertNotNull(status.getServers()); // exclude a dead region server - Assert.assertEquals(SLAVES, numRs); - // live servers = primary master + nums of regionservers - Assert.assertEquals(status.getServers().size() + 1 /*Master*/, numRs); + Assert.assertEquals(SLAVES -1, numRs); + // live servers = nums of regionservers + // By default, HMaster don't carry any regions so it won't report its load. + // Hence, it won't be in the server list. + Assert.assertEquals(status.getServers().size(), numRs); Assert.assertTrue(status.getRegionsCount() > 0); Assert.assertNotNull(status.getDeadServerNames()); Assert.assertEquals(1, status.getDeadServersSize());