saintstack commented on a change in pull request #295: HBASE-22551
TestMasterOperationsForRegionReplicas is flakey
URL: https://github.com/apache/hbase/pull/295#discussion_r291842988
##########
File path:
hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterOperationsForRegionReplicas.java
##########
@@ -90,18 +95,19 @@ public static void setupBeforeClass() throws Exception {
conf = TEST_UTIL.getConfiguration();
conf.setBoolean("hbase.tests.use.shortcircuit.reads", false);
TEST_UTIL.startMiniCluster(numSlaves);
+ TEST_UTIL.getAdmin().balancerSwitch(false, true);
CONNECTION =
ConnectionFactory.createConnection(TEST_UTIL.getConfiguration());
ADMIN = CONNECTION.getAdmin();
- while(ADMIN.getClusterMetrics(EnumSet.of(Option.LIVE_SERVERS))
- .getLiveServerMetrics().size() < numSlaves) {
+ while
(ADMIN.getClusterMetrics(EnumSet.of(Option.LIVE_SERVERS)).getLiveServerMetrics()
+ .size() < numSlaves) {
Thread.sleep(100);
}
}
@AfterClass
public static void tearDownAfterClass() throws Exception {
- if (ADMIN != null) ADMIN.close();
- if (CONNECTION != null && !CONNECTION.isClosed()) CONNECTION.close();
+ Closeables.close(ADMIN, true);
+ Closeables.close(CONNECTION, true);
Review comment:
This is a nice utility...
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services