You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2015/10/26 20:55:44 UTC

hbase git commit: HBASE-14698 Set category timeouts on TestScanner and TestNamespaceAuditor

Repository: hbase
Updated Branches:
  refs/heads/branch-1.2 dcce2ed09 -> f7ead928c


HBASE-14698 Set category timeouts on TestScanner and TestNamespaceAuditor


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

Branch: refs/heads/branch-1.2
Commit: f7ead928c0e030d491abf91da69c5724f7c9c225
Parents: dcce2ed
Author: stack <st...@apache.org>
Authored: Mon Oct 26 12:55:36 2015 -0700
Committer: stack <st...@apache.org>
Committed: Mon Oct 26 12:55:46 2015 -0700

----------------------------------------------------------------------
 .../hbase/io/encoding/TestDataBlockEncoders.java |  5 +----
 .../hbase/namespace/TestNamespaceAuditor.java    | 19 ++++++++++++-------
 .../hadoop/hbase/regionserver/TestScanner.java   |  5 +++++
 .../snapshot/TestFlushSnapshotFromClient.java    |  3 +--
 4 files changed, 19 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/f7ead928/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestDataBlockEncoders.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestDataBlockEncoders.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestDataBlockEncoders.java
index 4170b44..c9107e3 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestDataBlockEncoders.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestDataBlockEncoders.java
@@ -31,20 +31,17 @@ import java.util.List;
 import java.util.Random;
 
 import org.apache.hadoop.hbase.CategoryBasedTimeout;
-import org.apache.hadoop.hbase.Cell;
-import org.apache.hadoop.hbase.CellComparator;
-import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.KeyValue.Type;
 import org.apache.hadoop.hbase.KeyValueUtil;
-import org.apache.hadoop.hbase.testclassification.LargeTests;
 import org.apache.hadoop.hbase.Tag;
 import org.apache.hadoop.hbase.io.compress.Compression;
 import org.apache.hadoop.hbase.io.hfile.HFileBlock.Writer.BufferGrabbingByteArrayOutputStream;
 import org.apache.hadoop.hbase.io.hfile.HFileContext;
 import org.apache.hadoop.hbase.io.hfile.HFileContextBuilder;
+import org.apache.hadoop.hbase.testclassification.LargeTests;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.test.RedundantKVGenerator;
 import org.junit.Rule;

http://git-wip-us.apache.org/repos/asf/hbase/blob/f7ead928/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java
index 773bdab..b6fab17 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java
@@ -29,6 +29,7 @@ import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.CategoryBasedTimeout;
 import org.apache.hadoop.hbase.Coprocessor;
 import org.apache.hadoop.hbase.CoprocessorEnvironment;
 import org.apache.hadoop.hbase.DoNotRetryIOException;
@@ -78,13 +79,17 @@ import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Ignore;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestRule;
 
 import com.google.common.collect.Sets;
 
 @Category(MediumTests.class)
 public class TestNamespaceAuditor {
+  @Rule public final TestRule timeout = CategoryBasedTimeout.builder().
+      withTimeout(this.getClass()).withLookingForStuckThread(true).build();
   private static final Log LOG = LogFactory.getLog(TestNamespaceAuditor.class);
   private static final HBaseTestingUtility UTIL = new HBaseTestingUtility();
   private static HBaseAdmin ADMIN;
@@ -129,7 +134,7 @@ public class TestNamespaceAuditor {
         .getMasterQuotaManager().isQuotaEnabled());
   }
 
-  @Test(timeout = 60000)
+  @Test
   public void testTableOperations() throws Exception {
     String nsp = prefix + "_np2";
     NamespaceDescriptor nspDesc =
@@ -487,7 +492,7 @@ public class TestNamespaceAuditor {
    * namespace quota cache. Now correct the failure and recreate the table with same name.
    * HBASE-13394
    */
-  @Test(timeout = 180000)
+  @Test
   public void testRecreateTableWithSameNameAfterFirstTimeFailure() throws Exception {
     String nsp1 = prefix + "_testRecreateTable";
     NamespaceDescriptor nspDesc =
@@ -666,7 +671,7 @@ public class TestNamespaceAuditor {
     observer.tableDeletionLatch.await();
   }
 
-  @Test(expected = QuotaExceededException.class, timeout = 30000)
+  @Test(expected = QuotaExceededException.class)
   public void testExceedTableQuotaInNamespace() throws Exception {
     String nsp = prefix + "_testExceedTableQuotaInNamespace";
     NamespaceDescriptor nspDesc =
@@ -683,7 +688,7 @@ public class TestNamespaceAuditor {
     ADMIN.createTable(tableDescTwo, Bytes.toBytes("AAA"), Bytes.toBytes("ZZZ"), 4);
   }
   
-  @Test(expected = QuotaExceededException.class, timeout = 30000)
+  @Test(expected = QuotaExceededException.class)
   public void testCloneSnapshotQuotaExceed() throws Exception {
     String nsp = prefix + "_testTableQuotaExceedWithCloneSnapshot";
     NamespaceDescriptor nspDesc =
@@ -701,7 +706,7 @@ public class TestNamespaceAuditor {
     ADMIN.deleteSnapshot(snapshot);
   }
 
-  @Test(timeout = 180000)
+  @Test
   public void testCloneSnapshot() throws Exception {
     String nsp = prefix + "_testCloneSnapshot";
     NamespaceDescriptor nspDesc =
@@ -736,7 +741,7 @@ public class TestNamespaceAuditor {
     ADMIN.deleteSnapshot(snapshot);
   }
 
-  @Test(timeout = 180000)
+  @Test
   public void testRestoreSnapshot() throws Exception {
     String nsp = prefix + "_testRestoreSnapshot";
     NamespaceDescriptor nspDesc =
@@ -770,7 +775,7 @@ public class TestNamespaceAuditor {
     ADMIN.deleteSnapshot(snapshot);
   }
 
-  @Test(timeout = 180000)
+  @Test
   public void testRestoreSnapshotQuotaExceed() throws Exception {
     String nsp = prefix + "_testRestoreSnapshotQuotaExceed";
     NamespaceDescriptor nspDesc =

http://git-wip-us.apache.org/repos/asf/hbase/blob/f7ead928/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java
index 2f250fd..6d71433 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java
@@ -33,6 +33,7 @@ import java.util.List;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.hbase.CategoryBasedTimeout;
 import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.HBaseTestCase;
@@ -60,6 +61,7 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.junit.rules.TestName;
+import org.junit.rules.TestRule;
 
 
 /**
@@ -68,6 +70,9 @@ import org.junit.rules.TestName;
 @Category(SmallTests.class)
 public class TestScanner {
   @Rule public TestName name = new TestName();
+  @Rule public final TestRule timeout = CategoryBasedTimeout.builder().
+      withTimeout(this.getClass()).withLookingForStuckThread(true).build();
+
   private static final Log LOG = LogFactory.getLog(TestScanner.class);
   private final static HBaseTestingUtility TEST_UTIL = HBaseTestingUtility.createLocalHTU();
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/f7ead928/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestFlushSnapshotFromClient.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestFlushSnapshotFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestFlushSnapshotFromClient.java
index 710d4ae..d8c6ab5 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestFlushSnapshotFromClient.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestFlushSnapshotFromClient.java
@@ -37,8 +37,6 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HRegionInfo;
-import org.apache.hadoop.hbase.client.HTable;
-import org.apache.hadoop.hbase.testclassification.LargeTests;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.TableNotFoundException;
 import org.apache.hadoop.hbase.client.Admin;
@@ -47,6 +45,7 @@ import org.apache.hadoop.hbase.master.HMaster;
 import org.apache.hadoop.hbase.master.snapshot.SnapshotManager;
 import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription;
 import org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy;
+import org.apache.hadoop.hbase.testclassification.LargeTests;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.FSUtils;
 import org.junit.After;