HBASE-24489 Rewrite TestClusterRestartFailover.test since namespace table is gone on on master (#2025)
Signed-off-by: Guanghao Zhang <zghao@apache.org>
This commit is contained in:
parent
7b92510bb4
commit
1d0e285a6f
|
@ -41,12 +41,9 @@ import org.apache.hadoop.hbase.master.assignment.ServerState;
|
||||||
import org.apache.hadoop.hbase.master.assignment.ServerStateNode;
|
import org.apache.hadoop.hbase.master.assignment.ServerStateNode;
|
||||||
import org.apache.hadoop.hbase.master.procedure.ServerCrashProcedure;
|
import org.apache.hadoop.hbase.master.procedure.ServerCrashProcedure;
|
||||||
import org.apache.hadoop.hbase.procedure2.Procedure;
|
import org.apache.hadoop.hbase.procedure2.Procedure;
|
||||||
import org.apache.hadoop.hbase.regionserver.HRegionServer;
|
|
||||||
import org.apache.hadoop.hbase.test.MetricsAssertHelper;
|
import org.apache.hadoop.hbase.test.MetricsAssertHelper;
|
||||||
import org.apache.hadoop.hbase.testclassification.LargeTests;
|
import org.apache.hadoop.hbase.testclassification.LargeTests;
|
||||||
import org.apache.hadoop.hbase.testclassification.MasterTests;
|
import org.apache.hadoop.hbase.testclassification.MasterTests;
|
||||||
import org.apache.hadoop.hbase.util.JVMClusterUtil;
|
|
||||||
import org.apache.zookeeper.KeeperException;
|
|
||||||
import org.junit.ClassRule;
|
import org.junit.ClassRule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.experimental.categories.Category;
|
import org.junit.experimental.categories.Category;
|
||||||
|
@ -85,16 +82,7 @@ public class TestClusterRestartFailover extends AbstractTestRestartCluster {
|
||||||
setupCluster();
|
setupCluster();
|
||||||
setupTable();
|
setupTable();
|
||||||
|
|
||||||
// Find server that does not have hbase:namespace on it. This tests holds up SCPs. If it
|
SERVER_FOR_TEST = UTIL.getHBaseCluster().getRegionServer(0).getServerName();
|
||||||
// holds up the server w/ hbase:namespace, the Master initialization will be held up
|
|
||||||
// because this table is not online and test fails.
|
|
||||||
for (JVMClusterUtil.RegionServerThread rst:
|
|
||||||
UTIL.getHBaseCluster().getLiveRegionServerThreads()) {
|
|
||||||
HRegionServer rs = rst.getRegionServer();
|
|
||||||
if (rs.getRegions(TableName.NAMESPACE_TABLE_NAME).isEmpty()) {
|
|
||||||
SERVER_FOR_TEST = rs.getServerName();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
UTIL.waitFor(60000, () -> getServerStateNode(SERVER_FOR_TEST) != null);
|
UTIL.waitFor(60000, () -> getServerStateNode(SERVER_FOR_TEST) != null);
|
||||||
ServerStateNode serverNode = getServerStateNode(SERVER_FOR_TEST);
|
ServerStateNode serverNode = getServerStateNode(SERVER_FOR_TEST);
|
||||||
assertNotNull(serverNode);
|
assertNotNull(serverNode);
|
||||||
|
|
Loading…
Reference in New Issue