HBASE-20159 Support using separate ZK quorums for client - addendum fixes flaky TestSeparateClientZKCluster

This commit is contained in:
tedyu 2018-03-30 07:19:47 -07:00
parent 53b4507c79
commit e60f34fdb5
1 changed files with 7 additions and 2 deletions

View File

@ -29,6 +29,7 @@ import org.apache.hadoop.hbase.MiniHBaseCluster;
import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.ServerName;
import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.master.HMaster; import org.apache.hadoop.hbase.master.HMaster;
import org.apache.hadoop.hbase.master.NoSuchProcedureException;
import org.apache.hadoop.hbase.regionserver.HRegionServer; 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.Bytes; import org.apache.hadoop.hbase.util.Bytes;
@ -131,7 +132,7 @@ public class TestSeparateClientZKCluster {
while (!master.isShutDown()) { while (!master.isShutDown()) {
Thread.sleep(200); Thread.sleep(200);
} }
while (!cluster.getMaster().isInitialized()) { while (cluster.getMaster() == null || !cluster.getMaster().isInitialized()) {
Thread.sleep(200); Thread.sleep(200);
} }
// confirm client access still works // confirm client access still works
@ -228,8 +229,12 @@ public class TestSeparateClientZKCluster {
Thread.sleep(200); Thread.sleep(200);
} }
// wait for meta region online // wait for meta region online
try {
cluster.getMaster().getAssignmentManager() cluster.getMaster().getAssignmentManager()
.waitForAssignment(RegionInfoBuilder.FIRST_META_REGIONINFO); .waitForAssignment(RegionInfoBuilder.FIRST_META_REGIONINFO);
} catch (NoSuchProcedureException e) {
// we don't need to take any further action
}
// wait some long time to make sure we will retry sync data to client ZK until data set // wait some long time to make sure we will retry sync data to client ZK until data set
Thread.sleep(10000); Thread.sleep(10000);
clientZkCluster.startup(clientZkDir); clientZkCluster.startup(clientZkDir);