From 56a4420af1055db98a7ed3188ab1cbf91383a337 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Wed, 18 Apr 2012 21:31:00 +0000 Subject: [PATCH] HBASE-5817 Fix uncategorized tests git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1327691 13f79535-47bb-0310-9956-ffa450edef68 --- src/docbkx/developer.xml | 3 +++ .../hbase/coprocessor/TestRowProcessorEndpoint.java | 5 +++-- .../java/org/apache/hadoop/hbase/ipc/TestDelayedRpc.java | 1 + .../org/apache/hadoop/hbase/ipc/TestPBOnWritableRpc.java | 8 ++++++++ .../apache/hadoop/hbase/master/TestAssignmentManager.java | 3 ++- .../java/org/apache/hadoop/hbase/master/TestMXBean.java | 6 ++++++ .../apache/hadoop/hbase/master/TestMasterNoCluster.java | 7 +++++++ .../hadoop/hbase/metrics/TestExactCounterMetric.java | 7 +++++++ .../hbase/metrics/TestExponentiallyDecayingSample.java | 7 +++++++ .../apache/hadoop/hbase/metrics/TestMetricsHistogram.java | 7 +++++++ .../org/apache/hadoop/hbase/regionserver/TestMXBean.java | 7 +++++++ .../regionserver/TestRSKilledWhenMasterInitializing.java | 4 +++- .../apache/hadoop/hbase/util/TestProcessBasedCluster.java | 6 ++++++ 13 files changed, 67 insertions(+), 4 deletions(-) diff --git a/src/docbkx/developer.xml b/src/docbkx/developer.xml index 10269d886bb..dd63e2a3a00 100644 --- a/src/docbkx/developer.xml +++ b/src/docbkx/developer.xml @@ -338,7 +338,10 @@ report: "[INFO] Tests are skipped". It's harmless. Running mvn test -P runLargeTests execute medium tests in a single JVM. + +
+<command>hbasetests.sh</command> It's also possible to use the script hbasetests.sh. This script runs the medium and large tests in parallel with two maven instances, and provide a single report. It must be executed from the directory which contains the pom.xml. diff --git a/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRowProcessorEndpoint.java b/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRowProcessorEndpoint.java index cfcb6d6e002..7c1fd1e6066 100644 --- a/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRowProcessorEndpoint.java +++ b/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRowProcessorEndpoint.java @@ -34,7 +34,7 @@ import java.util.Set; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; - +import org.apache.hadoop.hbase.MediumTests; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.KeyValue; @@ -50,6 +50,7 @@ import org.apache.hadoop.hbase.regionserver.InternalScanner; import org.apache.hadoop.hbase.regionserver.wal.HLog; import org.apache.hadoop.hbase.regionserver.wal.WALEdit; import org.apache.hadoop.hbase.util.Bytes; + import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Writable; import org.junit.AfterClass; @@ -64,7 +65,7 @@ import com.sun.org.apache.commons.logging.LogFactory; * Verifies ProcessRowEndpoint works. * The tested RowProcessor performs two scans and a read-modify-write. */ -@Category(SmallTests.class) +@Category(MediumTests.class) public class TestRowProcessorEndpoint { static final Log LOG = LogFactory.getLog(TestRowProcessorEndpoint.class); diff --git a/src/test/java/org/apache/hadoop/hbase/ipc/TestDelayedRpc.java b/src/test/java/org/apache/hadoop/hbase/ipc/TestDelayedRpc.java index 5229b6d0500..220e13301d9 100644 --- a/src/test/java/org/apache/hadoop/hbase/ipc/TestDelayedRpc.java +++ b/src/test/java/org/apache/hadoop/hbase/ipc/TestDelayedRpc.java @@ -34,6 +34,7 @@ import junit.framework.Assert; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.ipc.VersionedProtocol; +import org.apache.hadoop.hbase.MediumTests; import org.apache.log4j.AppenderSkeleton; import org.apache.log4j.Logger; import org.apache.log4j.spi.LoggingEvent; diff --git a/src/test/java/org/apache/hadoop/hbase/ipc/TestPBOnWritableRpc.java b/src/test/java/org/apache/hadoop/hbase/ipc/TestPBOnWritableRpc.java index d5a906850d2..537cbe6928a 100644 --- a/src/test/java/org/apache/hadoop/hbase/ipc/TestPBOnWritableRpc.java +++ b/src/test/java/org/apache/hadoop/hbase/ipc/TestPBOnWritableRpc.java @@ -27,12 +27,16 @@ import java.net.InetSocketAddress; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Writable; +import org.apache.hadoop.hbase.MediumTests; import org.junit.Test; import com.google.protobuf.DescriptorProtos; import com.google.protobuf.DescriptorProtos.EnumDescriptorProto; +import org.junit.experimental.categories.Category; + /** Unit tests to test PB-based types on WritableRpcEngine. */ +@Category(MediumTests.class) public class TestPBOnWritableRpc { private static Configuration conf = new Configuration(); @@ -124,4 +128,8 @@ public class TestPBOnWritableRpc { public static void main(String[] args) throws Exception { new TestPBOnWritableRpc().testCallsInternal(conf); } + + @org.junit.Rule + public org.apache.hadoop.hbase.ResourceCheckerJUnitRule cu = + new org.apache.hadoop.hbase.ResourceCheckerJUnitRule(); } diff --git a/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManager.java b/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManager.java index 14830ef9b07..7ffd6bd72df 100644 --- a/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManager.java +++ b/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManager.java @@ -61,6 +61,7 @@ import org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper; import org.apache.hadoop.hbase.zookeeper.ZKAssign; import org.apache.hadoop.hbase.zookeeper.ZKUtil; import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; +import org.apache.hadoop.hbase.MediumTests; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.Watcher; import org.apache.zookeeper.KeeperException.NodeExistsException; @@ -79,7 +80,7 @@ import com.google.protobuf.ServiceException; /** * Test {@link AssignmentManager} */ -@Category(SmallTests.class) +@Category(MediumTests.class) public class TestAssignmentManager { private static final HBaseTestingUtility HTU = new HBaseTestingUtility(); private static final ServerName SERVERNAME_A = diff --git a/src/test/java/org/apache/hadoop/hbase/master/TestMXBean.java b/src/test/java/org/apache/hadoop/hbase/master/TestMXBean.java index 379f70c0ca8..bd5fa90ca70 100644 --- a/src/test/java/org/apache/hadoop/hbase/master/TestMXBean.java +++ b/src/test/java/org/apache/hadoop/hbase/master/TestMXBean.java @@ -26,10 +26,13 @@ import junit.framework.Assert; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HServerLoad; import org.apache.hadoop.hbase.regionserver.HRegionServer; +import org.apache.hadoop.hbase.MediumTests; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; +import org.junit.experimental.categories.Category; +@Category(MediumTests.class) public class TestMXBean { private static final HBaseTestingUtility TEST_UTIL = @@ -92,4 +95,7 @@ public class TestMXBean { } + @org.junit.Rule + public org.apache.hadoop.hbase.ResourceCheckerJUnitRule cu = + new org.apache.hadoop.hbase.ResourceCheckerJUnitRule(); } diff --git a/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java b/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java index 41b339ca368..f8029baefe4 100644 --- a/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java +++ b/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java @@ -44,6 +44,7 @@ import org.apache.hadoop.hbase.util.Threads; import org.apache.hadoop.hbase.zookeeper.RootRegionTracker; import org.apache.hadoop.hbase.zookeeper.ZKUtil; import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; +import org.apache.hadoop.hbase.MediumTests; import org.apache.hadoop.io.MapWritable; import org.apache.hadoop.io.Text; import org.apache.zookeeper.KeeperException; @@ -52,6 +53,7 @@ import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import org.mockito.Mockito; +import org.junit.experimental.categories.Category; /** * Standup the master and fake it to test various aspects of master function. @@ -61,6 +63,7 @@ import org.mockito.Mockito; * TODO: Speed up the zk connection by Master. It pauses 5 seconds establishing * session. */ +@Category(MediumTests.class) public class TestMasterNoCluster { private static final HBaseTestingUtility TESTUTIL = new HBaseTestingUtility(); @@ -326,4 +329,8 @@ public class TestMasterNoCluster { master.join(); } } + + @org.junit.Rule + public org.apache.hadoop.hbase.ResourceCheckerJUnitRule cu = + new org.apache.hadoop.hbase.ResourceCheckerJUnitRule(); } diff --git a/src/test/java/org/apache/hadoop/hbase/metrics/TestExactCounterMetric.java b/src/test/java/org/apache/hadoop/hbase/metrics/TestExactCounterMetric.java index c9e5b6e3af0..c276bd6ff9b 100644 --- a/src/test/java/org/apache/hadoop/hbase/metrics/TestExactCounterMetric.java +++ b/src/test/java/org/apache/hadoop/hbase/metrics/TestExactCounterMetric.java @@ -23,8 +23,11 @@ import java.util.List; import junit.framework.Assert; import org.apache.hadoop.hbase.util.Pair; +import org.apache.hadoop.hbase.SmallTests; import org.junit.Test; +import org.junit.experimental.categories.Category; +@Category(SmallTests.class) public class TestExactCounterMetric { @Test @@ -44,4 +47,8 @@ public class TestExactCounterMetric { i--; } } + + @org.junit.Rule + public org.apache.hadoop.hbase.ResourceCheckerJUnitRule cu = + new org.apache.hadoop.hbase.ResourceCheckerJUnitRule(); } diff --git a/src/test/java/org/apache/hadoop/hbase/metrics/TestExponentiallyDecayingSample.java b/src/test/java/org/apache/hadoop/hbase/metrics/TestExponentiallyDecayingSample.java index 8b0153e1878..142611aa606 100644 --- a/src/test/java/org/apache/hadoop/hbase/metrics/TestExponentiallyDecayingSample.java +++ b/src/test/java/org/apache/hadoop/hbase/metrics/TestExponentiallyDecayingSample.java @@ -22,8 +22,11 @@ import junit.framework.Assert; import org.apache.hadoop.hbase.metrics.histogram.ExponentiallyDecayingSample; import org.apache.hadoop.hbase.metrics.histogram.Snapshot; +import org.apache.hadoop.hbase.SmallTests; import org.junit.Test; +import org.junit.experimental.categories.Category; +@Category(SmallTests.class) public class TestExponentiallyDecayingSample { @Test @@ -60,4 +63,8 @@ public class TestExponentiallyDecayingSample { Assert.assertTrue(i >= 0.0 && i < 1000.0); } } + + @org.junit.Rule + public org.apache.hadoop.hbase.ResourceCheckerJUnitRule cu = + new org.apache.hadoop.hbase.ResourceCheckerJUnitRule(); } diff --git a/src/test/java/org/apache/hadoop/hbase/metrics/TestMetricsHistogram.java b/src/test/java/org/apache/hadoop/hbase/metrics/TestMetricsHistogram.java index 4b1ae151d7e..fae5521c532 100644 --- a/src/test/java/org/apache/hadoop/hbase/metrics/TestMetricsHistogram.java +++ b/src/test/java/org/apache/hadoop/hbase/metrics/TestMetricsHistogram.java @@ -23,9 +23,12 @@ import java.util.Random; import org.apache.hadoop.hbase.metrics.histogram.MetricsHistogram; import org.apache.hadoop.hbase.metrics.histogram.Snapshot; +import org.apache.hadoop.hbase.SmallTests; import org.junit.Assert; import org.junit.Test; +import org.junit.experimental.categories.Category; +@Category(SmallTests.class) public class TestMetricsHistogram { @Test @@ -95,4 +98,8 @@ public class TestMetricsHistogram { && s.get95thPercentile() <= maxAcceptableninetyFifth); } + + @org.junit.Rule + public org.apache.hadoop.hbase.ResourceCheckerJUnitRule cu = + new org.apache.hadoop.hbase.ResourceCheckerJUnitRule(); } diff --git a/src/test/java/org/apache/hadoop/hbase/regionserver/TestMXBean.java b/src/test/java/org/apache/hadoop/hbase/regionserver/TestMXBean.java index 83e02c7a214..8807ddd5869 100644 --- a/src/test/java/org/apache/hadoop/hbase/regionserver/TestMXBean.java +++ b/src/test/java/org/apache/hadoop/hbase/regionserver/TestMXBean.java @@ -21,10 +21,13 @@ import junit.framework.Assert; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.master.HMaster; +import org.apache.hadoop.hbase.MediumTests; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; +import org.junit.experimental.categories.Category; +@Category(MediumTests.class) public class TestMXBean { private static final HBaseTestingUtility TEST_UTIL = @@ -55,4 +58,8 @@ public class TestMXBean { Assert.assertEquals(rs.getZooKeeperWatcher().getQuorum(), info.getZookeeperQuorum()); } + + @org.junit.Rule + public org.apache.hadoop.hbase.ResourceCheckerJUnitRule cu = + new org.apache.hadoop.hbase.ResourceCheckerJUnitRule(); } diff --git a/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSKilledWhenMasterInitializing.java b/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSKilledWhenMasterInitializing.java index 8f8018dc77c..d37ad6fa36c 100644 --- a/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSKilledWhenMasterInitializing.java +++ b/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSKilledWhenMasterInitializing.java @@ -49,11 +49,14 @@ import org.apache.hadoop.hbase.master.TestMasterFailover; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.JVMClusterUtil.MasterThread; import org.apache.hadoop.hbase.util.Threads; +import org.apache.hadoop.hbase.LargeTests; import org.apache.zookeeper.KeeperException; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; +import org.junit.experimental.categories.Category; +@Category(LargeTests.class) public class TestRSKilledWhenMasterInitializing { private static final Log LOG = LogFactory.getLog(TestMasterFailover.class); @@ -257,5 +260,4 @@ public class TestRSKilledWhenMasterInitializing { @org.junit.Rule public org.apache.hadoop.hbase.ResourceCheckerJUnitRule cu = new org.apache.hadoop.hbase.ResourceCheckerJUnitRule(); - } diff --git a/src/test/java/org/apache/hadoop/hbase/util/TestProcessBasedCluster.java b/src/test/java/org/apache/hadoop/hbase/util/TestProcessBasedCluster.java index 8c0231b61f0..4666b4cc415 100644 --- a/src/test/java/org/apache/hadoop/hbase/util/TestProcessBasedCluster.java +++ b/src/test/java/org/apache/hadoop/hbase/util/TestProcessBasedCluster.java @@ -29,11 +29,14 @@ import org.apache.hadoop.hbase.HTestConst; import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.ResultScanner; +import org.apache.hadoop.hbase.MediumTests; import org.junit.Test; +import org.junit.experimental.categories.Category; /** * A basic unit test that spins up a local HBase cluster. */ +@Category(MediumTests.class) public class TestProcessBasedCluster { private static final Log LOG = LogFactory.getLog(TestProcessBasedCluster.class); @@ -86,4 +89,7 @@ public class TestProcessBasedCluster { assertTrue(pom.getPath() + " does not exist", pom.exists()); } + @org.junit.Rule + public org.apache.hadoop.hbase.ResourceCheckerJUnitRule cu = + new org.apache.hadoop.hbase.ResourceCheckerJUnitRule(); }