hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhang...@apache.org
Subject [03/14] hbase git commit: HBASE-19866 Add cateogry based timeout using Timeout Rule to TestRegionServerReportForDuty.
Date Sat, 27 Jan 2018 06:39:45 GMT
HBASE-19866 Add cateogry based timeout using Timeout Rule to TestRegionServerReportForDuty.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/01c34243
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/01c34243
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/01c34243

Branch: refs/heads/HBASE-19064
Commit: 01c34243fe3ba971fff0fd154f444118597533f1
Parents: 1beb687
Author: Apekshit Sharma <appy@apache.org>
Authored: Fri Jan 26 00:30:56 2018 -0800
Committer: Apekshit Sharma <appy@apache.org>
Committed: Fri Jan 26 00:30:56 2018 -0800

----------------------------------------------------------------------
 .../hbase/regionserver/TestRegionServerReportForDuty.java    | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/01c34243/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerReportForDuty.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerReportForDuty.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerReportForDuty.java
index b72f486..de97c07 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerReportForDuty.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerReportForDuty.java
@@ -23,6 +23,7 @@ import static org.junit.Assert.assertTrue;
 import java.io.IOException;
 
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.CategoryBasedTimeout;
 import org.apache.hadoop.hbase.CoordinatedStateManager;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 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.junit.After;
 import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestRule;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -46,6 +49,9 @@ import org.slf4j.LoggerFactory;
 public class TestRegionServerReportForDuty {
 
   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;
 
@@ -77,7 +83,7 @@ public class TestRegionServerReportForDuty {
    * Tests region sever reportForDuty with backup master becomes primary master after
    * the first master goes away.
    */
-  @Test (timeout=180000)
+  @Test
   public void testReportForDutyWithMasterChange() throws Exception {
 
     // Start a master and wait for it to become the active/primary master.


Mime
View raw message