HBASE-19866 Add cateogry based timeout using Timeout Rule to TestRegionServerReportForDuty.
This commit is contained in:
parent
f8295a810d
commit
c16dae13f2
|
@ -23,6 +23,7 @@ import static org.junit.Assert.assertTrue;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
|
import org.apache.hadoop.hbase.CategoryBasedTimeout;
|
||||||
import org.apache.hadoop.hbase.CoordinatedStateManager;
|
import org.apache.hadoop.hbase.CoordinatedStateManager;
|
||||||
import org.apache.hadoop.hbase.HBaseTestingUtility;
|
import org.apache.hadoop.hbase.HBaseTestingUtility;
|
||||||
import org.apache.hadoop.hbase.HConstants;
|
import org.apache.hadoop.hbase.HConstants;
|
||||||
|
@ -37,8 +38,10 @@ import org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread;
|
||||||
import org.apache.zookeeper.KeeperException;
|
import org.apache.zookeeper.KeeperException;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.experimental.categories.Category;
|
import org.junit.experimental.categories.Category;
|
||||||
|
import org.junit.rules.TestRule;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
@ -46,6 +49,9 @@ import org.slf4j.LoggerFactory;
|
||||||
public class TestRegionServerReportForDuty {
|
public class TestRegionServerReportForDuty {
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(TestRegionServerReportForDuty.class);
|
private static final Logger LOG = LoggerFactory.getLogger(TestRegionServerReportForDuty.class);
|
||||||
|
@Rule
|
||||||
|
public final TestRule timeout = CategoryBasedTimeout.builder().withTimeout(this.getClass())
|
||||||
|
.withLookingForStuckThread(true).build();
|
||||||
|
|
||||||
private static final long SLEEP_INTERVAL = 500;
|
private static final long SLEEP_INTERVAL = 500;
|
||||||
|
|
||||||
|
@ -77,7 +83,7 @@ public class TestRegionServerReportForDuty {
|
||||||
* Tests region sever reportForDuty with backup master becomes primary master after
|
* Tests region sever reportForDuty with backup master becomes primary master after
|
||||||
* the first master goes away.
|
* the first master goes away.
|
||||||
*/
|
*/
|
||||||
@Test (timeout=180000)
|
@Test
|
||||||
public void testReportForDutyWithMasterChange() throws Exception {
|
public void testReportForDutyWithMasterChange() throws Exception {
|
||||||
|
|
||||||
// Start a master and wait for it to become the active/primary master.
|
// Start a master and wait for it to become the active/primary master.
|
||||||
|
|
Loading…
Reference in New Issue