HBASE-2004 TestClientClusterStatus is flakey

This commit is contained in:
Michael Stack 2018-02-21 14:52:10 -08:00
parent 3f82098d4b
commit 3a3994223c
1 changed files with 9 additions and 7 deletions

View File

@ -37,6 +37,7 @@ import org.apache.hadoop.hbase.regionserver.HRegionServer;
import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.testclassification.MediumTests;
import org.apache.hadoop.hbase.util.JVMClusterUtil.MasterThread; import org.apache.hadoop.hbase.util.JVMClusterUtil.MasterThread;
import org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread; import org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread;
import org.apache.hadoop.hbase.util.Threads;
import org.junit.AfterClass; import org.junit.AfterClass;
import org.junit.Assert; import org.junit.Assert;
import org.junit.BeforeClass; import org.junit.BeforeClass;
@ -100,13 +101,14 @@ public class TestClientClusterStatus {
@Test @Test
public void testNone() throws Exception { public void testNone() throws Exception {
ClusterStatus status0 ClusterMetrics status0 = ADMIN.getClusterMetrics(EnumSet.allOf(Option.class));
= new ClusterStatus(ADMIN.getClusterMetrics(EnumSet.allOf(Option.class))); ClusterMetrics status1 = ADMIN.getClusterMetrics(EnumSet.noneOf(Option.class));
ClusterStatus status1 // Do a rough compare. More specific compares can fail because all regions not deployed yet
= new ClusterStatus(ADMIN.getClusterMetrics(EnumSet.noneOf(Option.class))); // or more requests than expected.
Assert.assertEquals(status0, status1); Assert.assertEquals(status0.getLiveServerMetrics().size(),
checkPbObjectNotNull(status0); status1.getLiveServerMetrics().size());
checkPbObjectNotNull(status1); checkPbObjectNotNull(new ClusterStatus(status0));
checkPbObjectNotNull(new ClusterStatus(status1));
} }
@Test @Test