HBASE-25389 [Flakey Tests] branch-2 TestMetaShutdownHandler (#2773)

Signed-off-by: Bharath Vissapragada <bharathv@apache.org>
This commit is contained in:
Michael Stack 2020-12-15 09:49:16 -08:00 committed by stack
parent d50816fe44
commit a4d42d1fcc
1 changed files with 3 additions and 0 deletions

View File

@ -32,6 +32,7 @@ import org.apache.hadoop.hbase.StartMiniClusterOption;
import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.Waiter;
import org.apache.hadoop.hbase.client.RegionInfoBuilder; import org.apache.hadoop.hbase.client.RegionInfoBuilder;
import org.apache.hadoop.hbase.master.assignment.RegionStates; import org.apache.hadoop.hbase.master.assignment.RegionStates;
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;
import org.apache.hadoop.hbase.zookeeper.MetaTableLocator; import org.apache.hadoop.hbase.zookeeper.MetaTableLocator;
@ -102,6 +103,7 @@ public class TestMetaShutdownHandler {
RegionState metaState = MetaTableLocator.getMetaRegionState(master.getZooKeeper()); RegionState metaState = MetaTableLocator.getMetaRegionState(master.getZooKeeper());
assertEquals("Wrong state for meta!", RegionState.State.OPEN, metaState.getState()); assertEquals("Wrong state for meta!", RegionState.State.OPEN, metaState.getState());
assertNotEquals("Meta is on master!", metaServerName, master.getServerName()); assertNotEquals("Meta is on master!", metaServerName, master.getServerName());
HRegionServer metaRegionServer = cluster.getRegionServer(metaServerName);
// Delete the ephemeral node of the meta-carrying region server. // Delete the ephemeral node of the meta-carrying region server.
// This is trigger the expire of this region server on the master. // This is trigger the expire of this region server on the master.
@ -113,6 +115,7 @@ public class TestMetaShutdownHandler {
// Wait for SSH to finish // Wait for SSH to finish
final ServerManager serverManager = master.getServerManager(); final ServerManager serverManager = master.getServerManager();
final ServerName priorMetaServerName = metaServerName; final ServerName priorMetaServerName = metaServerName;
TEST_UTIL.waitFor(60000, 100, () -> metaRegionServer.isStopped());
TEST_UTIL.waitFor(120000, 200, new Waiter.Predicate<Exception>() { TEST_UTIL.waitFor(120000, 200, new Waiter.Predicate<Exception>() {
@Override @Override
public boolean evaluate() throws Exception { public boolean evaluate() throws Exception {