You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zg...@apache.org on 2019/05/29 06:23:58 UTC
[hbase] branch branch-2.2 updated: HBASE-22488 Cleanup the explicit
timeout value for test methods
This is an automated email from the ASF dual-hosted git repository.
zghao pushed a commit to branch branch-2.2
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.2 by this push:
new 84994eb HBASE-22488 Cleanup the explicit timeout value for test methods
84994eb is described below
commit 84994ebc722191a98c951d9b2035456dadf5b2a0
Author: Guanghao <zg...@apache.org>
AuthorDate: Wed May 29 14:09:16 2019 +0800
HBASE-22488 Cleanup the explicit timeout value for test methods
---
.../client/TestSnapshotTemporaryDirectory.java | 32 ++++++++++++++--------
.../hbase/coprocessor/TestMetaTableMetrics.java | 2 +-
.../TestMasterHandlerFullWhenTransitRegion.java | 2 +-
.../hadoop/hbase/master/TestMasterNoCluster.java | 4 +--
.../hbase/master/cleaner/TestLogsCleaner.java | 2 +-
.../apache/hadoop/hbase/quotas/TestQuotaState.java | 2 +-
.../hadoop/hbase/regionserver/TestWALLockup.java | 2 +-
.../throttle/TestStoreHotnessProtector.java | 2 +-
.../security/access/TestAccessController.java | 4 +--
9 files changed, 31 insertions(+), 21 deletions(-)
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotTemporaryDirectory.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotTemporaryDirectory.java
index f58b947..3cbf88d 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotTemporaryDirectory.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotTemporaryDirectory.java
@@ -99,7 +99,8 @@ public class TestSnapshotTemporaryDirectory {
*
* @throws Exception on failure
*/
- @BeforeClass public static void setupCluster() throws Exception {
+ @BeforeClass
+ public static void setupCluster() throws Exception {
setupConf(UTIL.getConfiguration());
UTIL.startMiniCluster(NUM_RS);
admin = UTIL.getHBaseAdmin();
@@ -123,7 +124,8 @@ public class TestSnapshotTemporaryDirectory {
conf.set(SnapshotDescriptionUtils.SNAPSHOT_WORKING_DIR, "file://" + TEMP_DIR + "/.tmpdir/");
}
- @Before public void setup() throws Exception {
+ @Before
+ public void setup() throws Exception {
HTableDescriptor htd = new HTableDescriptor(TABLE_NAME);
htd.setRegionReplication(getNumReplicas());
UTIL.createTable(htd, new byte[][] { TEST_FAM }, UTIL.getConfiguration());
@@ -133,13 +135,15 @@ public class TestSnapshotTemporaryDirectory {
return 1;
}
- @After public void tearDown() throws Exception {
+ @After
+ public void tearDown() throws Exception {
UTIL.deleteTable(TABLE_NAME);
SnapshotTestingUtils.deleteAllSnapshots(UTIL.getHBaseAdmin());
SnapshotTestingUtils.deleteArchiveDirectory(UTIL);
}
- @AfterClass public static void cleanupTest() {
+ @AfterClass
+ public static void cleanupTest() {
try {
UTIL.shutdownMiniCluster();
FileUtils.deleteDirectory(new File(TEMP_DIR));
@@ -148,7 +152,8 @@ public class TestSnapshotTemporaryDirectory {
}
}
- @Test(timeout = 180000) public void testRestoreDisabledSnapshot()
+ @Test
+ public void testRestoreDisabledSnapshot()
throws IOException, InterruptedException {
long tid = System.currentTimeMillis();
TableName tableName = TableName.valueOf("testtb-" + tid);
@@ -214,7 +219,8 @@ public class TestSnapshotTemporaryDirectory {
SnapshotTestingUtils.verifyReplicasCameOnline(tableName, admin, getNumReplicas());
}
- @Test(timeout = 180000) public void testRestoreEnabledSnapshot()
+ @Test
+ public void testRestoreEnabledSnapshot()
throws IOException, InterruptedException {
long tid = System.currentTimeMillis();
TableName tableName = TableName.valueOf("testtb-" + tid);
@@ -281,7 +287,8 @@ public class TestSnapshotTemporaryDirectory {
*
* @throws Exception if snapshot does not complete successfully
*/
- @Test(timeout = 300000) public void testOfflineTableSnapshot() throws Exception {
+ @Test
+ public void testOfflineTableSnapshot() throws Exception {
Admin admin = UTIL.getHBaseAdmin();
// make sure we don't fail on listing snapshots
SnapshotTestingUtils.assertNoSnapshots(admin);
@@ -335,7 +342,8 @@ public class TestSnapshotTemporaryDirectory {
*
* @throws Exception if snapshot does not complete successfully
*/
- @Test(timeout = 180000) public void testSnapshotCloneContents() throws Exception {
+ @Test
+ public void testSnapshotCloneContents() throws Exception {
// make sure we don't fail on listing snapshots
SnapshotTestingUtils.assertNoSnapshots(admin);
@@ -371,7 +379,8 @@ public class TestSnapshotTemporaryDirectory {
admin.close();
}
- @Test(timeout = 180000) public void testOfflineTableSnapshotWithEmptyRegion() throws Exception {
+ @Test
+ public void testOfflineTableSnapshotWithEmptyRegion() throws Exception {
// test with an empty table with one region
// make sure we don't fail on listing snapshots
@@ -416,7 +425,8 @@ public class TestSnapshotTemporaryDirectory {
}
// Ensures that the snapshot is transferred to the proper completed snapshot directory
- @Test(timeout = 180000) public void testEnsureTemporaryDirectoryTransfer() throws Exception {
+ @Test
+ public void testEnsureTemporaryDirectoryTransfer() throws Exception {
Admin admin = null;
TableName tableName2 = TableName.valueOf("testListTableSnapshots");
try {
@@ -468,4 +478,4 @@ public class TestSnapshotTemporaryDirectory {
manifestVersion);
admin.snapshot(desc);
}
-}
\ No newline at end of file
+}
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMetaTableMetrics.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMetaTableMetrics.java
index 82ce709..16db86d 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMetaTableMetrics.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMetaTableMetrics.java
@@ -232,7 +232,7 @@ public class TestMetaTableMetrics {
assertEquals(5L, putWithClientMetricsCount);
}
- @Test(timeout = 30000)
+ @Test
public void testConcurrentAccess() {
try {
tablename = Bytes.toBytes("hbase:meta");
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterHandlerFullWhenTransitRegion.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterHandlerFullWhenTransitRegion.java
index e136cdd..e41054e 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterHandlerFullWhenTransitRegion.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterHandlerFullWhenTransitRegion.java
@@ -63,7 +63,7 @@ public class TestMasterHandlerFullWhenTransitRegion {
UTIL.createTable(TableName.valueOf(TABLENAME), "fa");
}
- @Test(timeout = 30000)
+ @Test
public void test() throws Exception {
RegionInfo regionInfo = UTIL.getAdmin().getRegions(TableName.valueOf(TABLENAME)).get(0);
//See HBASE-21754
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java
index 3aa0396..15b14b4 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java
@@ -309,7 +309,7 @@ public class TestMasterNoCluster {
}
}
- @Test(timeout = 60000)
+ @Test
public void testMasterInitWithSameClientServerZKQuorum() throws Exception {
Configuration conf = new Configuration(TESTUTIL.getConfiguration());
conf.set(HConstants.CLIENT_ZOOKEEPER_QUORUM, HConstants.LOCALHOST);
@@ -320,7 +320,7 @@ public class TestMasterNoCluster {
master.join();
}
- @Test(timeout = 60000)
+ @Test
public void testMasterInitWithObserverModeClientZKQuorum() throws Exception {
Configuration conf = new Configuration(TESTUTIL.getConfiguration());
Assert.assertFalse(Boolean.getBoolean(HConstants.CLIENT_ZOOKEEPER_OBSERVER_MODE));
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestLogsCleaner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestLogsCleaner.java
index fdb2371..30b2728 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestLogsCleaner.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestLogsCleaner.java
@@ -261,7 +261,7 @@ public class TestLogsCleaner {
* When zk is working both files should be returned
* @throws Exception from ZK watcher
*/
- @Test(timeout=10000)
+ @Test
public void testZooKeeperNormal() throws Exception {
ReplicationLogCleaner cleaner = new ReplicationLogCleaner();
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaState.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaState.java
index 73b253c..4c359f0 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaState.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaState.java
@@ -203,7 +203,7 @@ public class TestQuotaState {
assertNoopLimiter(quotaInfo.getTableLimiter(UNKNOWN_TABLE_NAME));
}
- @Test(timeout = 60000)
+ @Test
public void testTableThrottleWithBatch() {
final TableName TABLE_A = TableName.valueOf("TableA");
final int TABLE_A_THROTTLE_1 = 3;
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALLockup.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALLockup.java
index 0838eff..95574d6 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALLockup.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALLockup.java
@@ -313,7 +313,7 @@ public class TestWALLockup {
* If below is broken, we will see this test timeout because RingBufferEventHandler was stuck in
* attainSafePoint. Everyone will wait for sync to finish forever. See HBASE-14317.
*/
- @Test (timeout=30000)
+ @Test
public void testRingBufferEventHandlerStuckWhenSyncFailed()
throws IOException, InterruptedException {
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestStoreHotnessProtector.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestStoreHotnessProtector.java
index 6d41934..a73d366 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestStoreHotnessProtector.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestStoreHotnessProtector.java
@@ -52,7 +52,7 @@ public class TestStoreHotnessProtector {
@ClassRule public static final HBaseClassTestRule CLASS_RULE =
HBaseClassTestRule.forClass(TestStoreHotnessProtector.class);
- @Test(timeout = 60000)
+ @Test
public void testPreparePutCounter() throws Exception {
ExecutorService executorService = Executors.newFixedThreadPool(10);
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
index 9c90af8..2ce2642 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
@@ -3167,7 +3167,7 @@ public class TestAccessController extends SecureTestUtil {
verifyDenied(action, USER_CREATE, USER_RW, USER_RO, USER_NONE, USER_OWNER, USER_ADMIN);
}
- @Test(timeout = 180000)
+ @Test
public void testGetUserPermissions() throws Throwable {
Connection conn = null;
try {
@@ -3295,7 +3295,7 @@ public class TestAccessController extends SecureTestUtil {
}
}
- @Test(timeout = 180000)
+ @Test
public void testHasPermission() throws Throwable {
Connection conn = null;
try {