diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml index 401e28e..782758a 100644 --- a/hbase-client/pom.xml +++ b/hbase-client/pom.xml @@ -100,6 +100,13 @@ + + maven-surefire-plugin + ${surefire.version} + + ${surefire.firstPartGroups} + + diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml index a3a1526..e282bbf 100644 --- a/hbase-common/pom.xml +++ b/hbase-common/pom.xml @@ -160,6 +160,13 @@ + + maven-surefire-plugin + ${surefire.version} + + ${surefire.firstPartGroups} + + diff --git a/hbase-external-blockcache/pom.xml b/hbase-external-blockcache/pom.xml index a46f1a5..19fe8e7 100644 --- a/hbase-external-blockcache/pom.xml +++ b/hbase-external-blockcache/pom.xml @@ -184,6 +184,13 @@ + + maven-surefire-plugin + ${surefire.version} + + ${surefire.firstPartGroups} + + diff --git a/hbase-hadoop-compat/pom.xml b/hbase-hadoop-compat/pom.xml index 016dd24..d0b97ab 100644 --- a/hbase-hadoop-compat/pom.xml +++ b/hbase-hadoop-compat/pom.xml @@ -102,6 +102,13 @@ + + maven-surefire-plugin + ${surefire.version} + + ${surefire.firstPartGroups} + + diff --git a/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/master/TestMetricsMasterSourceFactory.java b/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/master/TestMetricsMasterSourceFactory.java index 91efd39..3f97bb3 100644 --- a/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/master/TestMetricsMasterSourceFactory.java +++ b/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/master/TestMetricsMasterSourceFactory.java @@ -19,9 +19,8 @@ package org.apache.hadoop.hbase.master; import org.apache.hadoop.hbase.CompatibilitySingletonFactory; -import org.apache.hadoop.hbase.master.MetricsMasterSource; -import org.apache.hadoop.hbase.testclassification.SmallTests; import org.apache.hadoop.hbase.testclassification.MetricsTests; +import org.apache.hadoop.hbase.testclassification.SmallTests; import org.junit.Test; import org.junit.experimental.categories.Category; @@ -35,6 +34,5 @@ public class TestMetricsMasterSourceFactory { public void testGetInstanceNoHadoopCompat() throws Exception { //This should throw an exception because there is no compat lib on the class path. CompatibilitySingletonFactory.getInstance(MetricsMasterSourceFactory.class); - } -} +} \ No newline at end of file diff --git a/hbase-hadoop2-compat/pom.xml b/hbase-hadoop2-compat/pom.xml index bae47d9..afbf28a 100644 --- a/hbase-hadoop2-compat/pom.xml +++ b/hbase-hadoop2-compat/pom.xml @@ -135,6 +135,13 @@ limitations under the License. + + maven-surefire-plugin + ${surefire.version} + + ${surefire.firstPartGroups} + + diff --git a/hbase-prefix-tree/pom.xml b/hbase-prefix-tree/pom.xml index 03b4000..f9187fe 100644 --- a/hbase-prefix-tree/pom.xml +++ b/hbase-prefix-tree/pom.xml @@ -99,6 +99,13 @@ + + maven-surefire-plugin + ${surefire.version} + + ${surefire.firstPartGroups} + + diff --git a/hbase-procedure/pom.xml b/hbase-procedure/pom.xml index 4b396ce..e95e86e 100644 --- a/hbase-procedure/pom.xml +++ b/hbase-procedure/pom.xml @@ -71,6 +71,17 @@ + + + + maven-surefire-plugin + ${surefire.version} + + ${surefire.firstPartGroups} + + + + diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/util/TestTimeoutBlockingQueue.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/util/TestTimeoutBlockingQueue.java index aff536a..399cc97 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/util/TestTimeoutBlockingQueue.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/util/TestTimeoutBlockingQueue.java @@ -19,28 +19,25 @@ package org.apache.hadoop.hbase.procedure2.util; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + import java.util.Arrays; import java.util.concurrent.TimeUnit; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.hbase.CategoryBasedTimeout; import org.apache.hadoop.hbase.procedure2.util.TimeoutBlockingQueue.TimeoutRetriever; -import org.apache.hadoop.hbase.testclassification.SmallTests; import org.apache.hadoop.hbase.testclassification.MasterTests; - -import org.junit.Assert; +import org.apache.hadoop.hbase.testclassification.MediumTests; +import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; +import org.junit.rules.TestRule; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -@Category({MasterTests.class, SmallTests.class}) +@Category({MasterTests.class, MediumTests.class}) public class TestTimeoutBlockingQueue { - private static final Log LOG = LogFactory.getLog(TestTimeoutBlockingQueue.class); - + @Rule public final TestRule timeout = CategoryBasedTimeout.builder().withTimeout(this.getClass()). + withLookingForStuckThread(true).build(); static class TestObject { private long timeout; private int seqId; diff --git a/hbase-protocol/pom.xml b/hbase-protocol/pom.xml index 8034576..6fe783c 100644 --- a/hbase-protocol/pom.xml +++ b/hbase-protocol/pom.xml @@ -101,6 +101,13 @@ + + maven-surefire-plugin + ${surefire.version} + + ${surefire.firstPartGroups} + + diff --git a/hbase-rest/pom.xml b/hbase-rest/pom.xml index 3443afc..fb1d80c 100644 --- a/hbase-rest/pom.xml +++ b/hbase-rest/pom.xml @@ -175,6 +175,13 @@ + + maven-surefire-plugin + ${surefire.version} + + ${surefire.firstPartGroups} + + diff --git a/hbase-server/pom.xml b/hbase-server/pom.xml index 6ea1817..9e53062 100644 --- a/hbase-server/pom.xml +++ b/hbase-server/pom.xml @@ -347,8 +347,6 @@ maven-surefire-plugin ${surefire.version} - ${surefire.firstPartGroups} diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcClientLeaks.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcClientLeaks.java index 596b8ab..d3e5767 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcClientLeaks.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcClientLeaks.java @@ -17,15 +17,18 @@ */ package org.apache.hadoop.hbase.ipc; +import static org.apache.hadoop.hbase.HBaseTestingUtility.fam1; +import static org.junit.Assert.assertTrue; + import java.io.IOException; import java.net.Socket; import java.net.SocketAddress; import java.util.List; -import com.google.common.collect.Lists; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.CategoryBasedTimeout; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; @@ -36,7 +39,7 @@ import org.apache.hadoop.hbase.client.MetricsConnection; import org.apache.hadoop.hbase.client.RetriesExhaustedException; import org.apache.hadoop.hbase.client.Table; import org.apache.hadoop.hbase.codec.Codec; -import org.apache.hadoop.hbase.testclassification.SmallTests; +import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.io.compress.CompressionCodec; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -44,12 +47,14 @@ import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; +import org.junit.rules.TestRule; -import static org.apache.hadoop.hbase.HBaseTestingUtility.fam1; -import static org.junit.Assert.*; +import com.google.common.collect.Lists; -@Category(SmallTests.class) +@Category(MediumTests.class) public class TestRpcClientLeaks { + @Rule public final TestRule timeout = CategoryBasedTimeout.builder().withTimeout(this.getClass()). + withLookingForStuckThread(true).build(); public static class MyRpcClientImpl extends RpcClientImpl { public static List savedSockets = Lists.newArrayList(); @@ -113,5 +118,4 @@ public class TestRpcClientLeaks { assertTrue("Socket + " + socket + " is not closed", socket.isClosed()); } } -} - +} \ No newline at end of file diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestHFileLinkCleaner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestHFileLinkCleaner.java index 66874e6..d6f1606 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestHFileLinkCleaner.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestHFileLinkCleaner.java @@ -27,6 +27,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; +import org.apache.hadoop.hbase.CategoryBasedTimeout; import org.apache.hadoop.hbase.ChoreService; import org.apache.hadoop.hbase.CoordinatedStateManager; import org.apache.hadoop.hbase.HBaseTestingUtility; @@ -37,20 +38,24 @@ import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ClusterConnection; import org.apache.hadoop.hbase.io.HFileLink; import org.apache.hadoop.hbase.testclassification.MasterTests; -import org.apache.hadoop.hbase.testclassification.SmallTests; +import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.util.FSUtils; import org.apache.hadoop.hbase.util.HFileArchiveUtil; import org.apache.hadoop.hbase.zookeeper.MetaTableLocator; import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; +import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; +import org.junit.rules.TestRule; /** * Test the HFileLink Cleaner. * HFiles with links cannot be deleted until a link is present. */ -@Category({MasterTests.class, SmallTests.class}) +@Category({MasterTests.class, MediumTests.class}) public class TestHFileLinkCleaner { + @Rule public final TestRule timeout = CategoryBasedTimeout.builder().withTimeout(this.getClass()). + withLookingForStuckThread(true).build(); private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java index 2bd22a8..eca7703 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java @@ -32,6 +32,7 @@ import java.util.Set; 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.HBaseTestingUtility; import org.apache.hadoop.hbase.HColumnDescriptor; @@ -43,18 +44,20 @@ import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Durability; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.testclassification.RegionServerTests; -import org.apache.hadoop.hbase.testclassification.SmallTests; import org.apache.hadoop.hbase.util.Bytes; import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.rules.TestName; +import org.junit.rules.TestRule; -@Category({RegionServerTests.class, SmallTests.class}) +@Category({RegionServerTests.class, MediumTests.class}) public class TestColumnSeeking { @Rule public TestName name = new TestName(); - + @Rule public final TestRule timeout = CategoryBasedTimeout.builder().withTimeout(this.getClass()). + withLookingForStuckThread(true).build(); private final static HBaseTestingUtility TEST_UTIL = HBaseTestingUtility.createLocalHTU(); private static final Log LOG = LogFactory.getLog(TestColumnSeeking.class); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiVersionConcurrencyControl.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiVersionConcurrencyControl.java index a639e2c..1c2a4cd 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiVersionConcurrencyControl.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiVersionConcurrencyControl.java @@ -17,21 +17,21 @@ */ package org.apache.hadoop.hbase.regionserver; -import junit.framework.TestCase; -import org.apache.hadoop.hbase.testclassification.RegionServerTests; -import org.apache.hadoop.hbase.testclassification.SmallTests; -import org.junit.experimental.categories.Category; - import java.util.Random; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; +import org.apache.hadoop.hbase.testclassification.MediumTests; +import org.apache.hadoop.hbase.testclassification.RegionServerTests; +import org.junit.Assert; +import org.junit.experimental.categories.Category; + /** * This is a hammer test that verifies MultiVersionConcurrencyControl in a * multiple writer single reader scenario. */ -@Category({RegionServerTests.class, SmallTests.class}) -public class TestMultiVersionConcurrencyControl extends TestCase { +@Category({RegionServerTests.class, MediumTests.class}) +public class TestMultiVersionConcurrencyControl { static class Writer implements Runnable { final AtomicBoolean finished; final MultiVersionConcurrencyControl mvcc; @@ -47,7 +47,6 @@ public class TestMultiVersionConcurrencyControl extends TestCase { public boolean failed = false; public void run() { - AtomicLong startPoint = new AtomicLong(); while (!finished.get()) { MultiVersionConcurrencyControl.WriteEntry e = mvcc.begin(); @@ -125,9 +124,9 @@ public class TestMultiVersionConcurrencyControl extends TestCase { } // check failure. - assertFalse(readerFailed.get()); + Assert.assertFalse(readerFailed.get()); for (int i = 0; i < n; ++i) { - assertTrue(statuses[i].get()); + Assert.assertTrue(statuses[i].get()); } } } \ No newline at end of file diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollingNoCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollingNoCluster.java index 08c1b15..0c68fc1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollingNoCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollingNoCluster.java @@ -25,6 +25,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; +import org.apache.hadoop.hbase.CategoryBasedTimeout; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; @@ -32,21 +33,25 @@ import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.regionserver.MultiVersionConcurrencyControl; +import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.testclassification.RegionServerTests; -import org.apache.hadoop.hbase.testclassification.SmallTests; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.FSUtils; import org.apache.hadoop.hbase.wal.WAL; import org.apache.hadoop.hbase.wal.WALFactory; import org.apache.hadoop.hbase.wal.WALKey; +import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; +import org.junit.rules.TestRule; /** * Test many concurrent appenders to an WAL while rolling the log. */ -@Category({RegionServerTests.class, SmallTests.class}) +@Category({RegionServerTests.class, MediumTests.class}) public class TestLogRollingNoCluster { + @Rule public final TestRule timeout = CategoryBasedTimeout.builder().withTimeout(this.getClass()). + withLookingForStuckThread(true).build(); private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); private final static byte [] EMPTY_1K_ARRAY = new byte[1024]; private static final int THREAD_COUNT = 100; // Spin up this many threads diff --git a/hbase-spark/pom.xml b/hbase-spark/pom.xml index ec911bd..36c965d 100644 --- a/hbase-spark/pom.xml +++ b/hbase-spark/pom.xml @@ -647,6 +647,17 @@ + + + + maven-surefire-plugin + ${surefire.version} + + ${surefire.firstPartGroups} + + + + diff --git a/hbase-thrift/pom.xml b/hbase-thrift/pom.xml index f7ab7f1..5a449cd 100644 --- a/hbase-thrift/pom.xml +++ b/hbase-thrift/pom.xml @@ -656,6 +656,17 @@ the same time. --> + + + + maven-surefire-plugin + ${surefire.version} + + ${surefire.firstPartGroups} + + + + diff --git a/pom.xml b/pom.xml index 5bcdbc5..223d123 100644 --- a/pom.xml +++ b/pom.xml @@ -1237,7 +1237,8 @@ false false 1 - 2 + + 1C org.apache.hadoop.hbase.testclassification.SmallTests org.apache.hadoop.hbase.testclassification.MediumTests false @@ -2282,27 +2283,7 @@ See as well the properties of the project for the values when no profile is active. --> - - nonParallelTests - - false - - - 1 - - - - - parallelTests - - false - - - 1 - - - - + singleJVMTests false @@ -2376,7 +2357,7 @@ 1 - 5 + 1C false false org.apache.hadoop.hbase.testclassification.SmallTests