HBASE-19237: TestMaster.testMasterOpsWhileSplitting fails

Signed-off-by: tedyu <yuzhihong@gmail.com>
This commit is contained in:
Yi Liang 2017-11-10 14:43:46 -08:00 committed by tedyu
parent 04a87fe156
commit 57aa6b32a2
1 changed files with 5 additions and 7 deletions

View File

@ -107,15 +107,13 @@ public class TestMaster {
// Now trigger a split and stop when the split is in progress // Now trigger a split and stop when the split is in progress
LOG.info("Splitting table"); LOG.info("Splitting table");
TEST_UTIL.getAdmin().split(TABLENAME); TEST_UTIL.getAdmin().split(TABLENAME);
LOG.info("Waiting for split result to be about to open");
RegionStates regionStates = m.getAssignmentManager().getRegionStates(); LOG.info("Making sure we can call getTableRegions while opening");
while (regionStates.getRegionsOfTable(TABLENAME).size() <= 1) { while (tableRegions.size() < 3) {
tableRegions = MetaTableAccessor.getTableRegionsAndLocations(m.getConnection(),
TABLENAME, false);
Thread.sleep(100); Thread.sleep(100);
} }
LOG.info("Making sure we can call getTableRegions while opening");
tableRegions = MetaTableAccessor.getTableRegionsAndLocations(m.getConnection(),
TABLENAME, false);
LOG.info("Regions: " + Joiner.on(',').join(tableRegions)); LOG.info("Regions: " + Joiner.on(',').join(tableRegions));
// We have three regions because one is split-in-progress // We have three regions because one is split-in-progress
assertEquals(3, tableRegions.size()); assertEquals(3, tableRegions.size());