Skip to content

Commit cf6e246

Browse files
committed
HBASE-22488 Cleanup the explicit timeout value for test methods
1 parent 858d30d commit cf6e246

File tree

7 files changed

+27
-18
lines changed

7 files changed

+27
-18
lines changed

hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotTemporaryDirectory.java

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ public class TestSnapshotTemporaryDirectory {
100100
*
101101
* @throws Exception on failure
102102
*/
103-
@BeforeClass public static void setupCluster() throws Exception {
103+
@BeforeClass
104+
public static void setupCluster() throws Exception {
104105
setupConf(UTIL.getConfiguration());
105106
UTIL.startMiniCluster(NUM_RS);
106107
admin = UTIL.getHBaseAdmin();
@@ -124,7 +125,8 @@ private static void setupConf(Configuration conf) {
124125
conf.set(SnapshotDescriptionUtils.SNAPSHOT_WORKING_DIR, "file://" + new Path(TEMP_DIR, ".tmpDir").toUri());
125126
}
126127

127-
@Before public void setup() throws Exception {
128+
@Before
129+
public void setup() throws Exception {
128130
HTableDescriptor htd = new HTableDescriptor(TABLE_NAME);
129131
htd.setRegionReplication(getNumReplicas());
130132
UTIL.createTable(htd, new byte[][] { TEST_FAM }, UTIL.getConfiguration());
@@ -134,13 +136,15 @@ protected int getNumReplicas() {
134136
return 1;
135137
}
136138

137-
@After public void tearDown() throws Exception {
139+
@After
140+
public void tearDown() throws Exception {
138141
UTIL.deleteTable(TABLE_NAME);
139142
SnapshotTestingUtils.deleteAllSnapshots(UTIL.getHBaseAdmin());
140143
SnapshotTestingUtils.deleteArchiveDirectory(UTIL);
141144
}
142145

143-
@AfterClass public static void cleanupTest() {
146+
@AfterClass
147+
public static void cleanupTest() {
144148
try {
145149
UTIL.shutdownMiniCluster();
146150
FileUtils.deleteDirectory(new File(TEMP_DIR));
@@ -149,7 +153,8 @@ protected int getNumReplicas() {
149153
}
150154
}
151155

152-
@Test(timeout = 180000) public void testRestoreDisabledSnapshot()
156+
@Test
157+
public void testRestoreDisabledSnapshot()
153158
throws IOException, InterruptedException {
154159
long tid = System.currentTimeMillis();
155160
TableName tableName = TableName.valueOf("testtb-" + tid);
@@ -215,7 +220,8 @@ protected int getNumReplicas() {
215220
SnapshotTestingUtils.verifyReplicasCameOnline(tableName, admin, getNumReplicas());
216221
}
217222

218-
@Test(timeout = 180000) public void testRestoreEnabledSnapshot()
223+
@Test
224+
public void testRestoreEnabledSnapshot()
219225
throws IOException, InterruptedException {
220226
long tid = System.currentTimeMillis();
221227
TableName tableName = TableName.valueOf("testtb-" + tid);
@@ -282,7 +288,8 @@ protected int getNumReplicas() {
282288
*
283289
* @throws Exception if snapshot does not complete successfully
284290
*/
285-
@Test(timeout = 300000) public void testOfflineTableSnapshot() throws Exception {
291+
@Test
292+
public void testOfflineTableSnapshot() throws Exception {
286293
Admin admin = UTIL.getHBaseAdmin();
287294
// make sure we don't fail on listing snapshots
288295
SnapshotTestingUtils.assertNoSnapshots(admin);
@@ -336,7 +343,8 @@ protected int getNumReplicas() {
336343
*
337344
* @throws Exception if snapshot does not complete successfully
338345
*/
339-
@Test(timeout = 180000) public void testSnapshotCloneContents() throws Exception {
346+
@Test
347+
public void testSnapshotCloneContents() throws Exception {
340348
// make sure we don't fail on listing snapshots
341349
SnapshotTestingUtils.assertNoSnapshots(admin);
342350

@@ -372,7 +380,8 @@ protected int getNumReplicas() {
372380
admin.close();
373381
}
374382

375-
@Test(timeout = 180000) public void testOfflineTableSnapshotWithEmptyRegion() throws Exception {
383+
@Test
384+
public void testOfflineTableSnapshotWithEmptyRegion() throws Exception {
376385
// test with an empty table with one region
377386

378387
// make sure we don't fail on listing snapshots
@@ -417,7 +426,7 @@ protected int getNumReplicas() {
417426
}
418427

419428
// Ensures that the snapshot is transferred to the proper completed snapshot directory
420-
@Test(timeout = 180000)
429+
@Test
421430
public void testEnsureTemporaryDirectoryTransfer() throws Exception {
422431
Admin admin = UTIL.getAdmin();
423432
TableName tableName2 = TableName.valueOf("testListTableSnapshots");

hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMetaTableMetrics.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ public void test() throws IOException, InterruptedException {
232232
assertEquals(5L, putWithClientMetricsCount);
233233
}
234234

235-
@Test(timeout = 30000)
235+
@Test
236236
public void testConcurrentAccess() {
237237
try {
238238
tablename = Bytes.toBytes("hbase:meta");

hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterHandlerFullWhenTransitRegion.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public static void setUp() throws Exception {
6363
UTIL.createTable(TableName.valueOf(TABLENAME), "fa");
6464
}
6565

66-
@Test(timeout = 30000)
66+
@Test
6767
public void test() throws Exception {
6868
RegionInfo regionInfo = UTIL.getAdmin().getRegions(TableName.valueOf(TABLENAME)).get(0);
6969
//See HBASE-21754

hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ public ClusterConnection getConnection() {
309309
}
310310
}
311311

312-
@Test(timeout = 60000)
312+
@Test
313313
public void testMasterInitWithSameClientServerZKQuorum() throws Exception {
314314
Configuration conf = new Configuration(TESTUTIL.getConfiguration());
315315
conf.set(HConstants.CLIENT_ZOOKEEPER_QUORUM, HConstants.LOCALHOST);
@@ -320,7 +320,7 @@ public void testMasterInitWithSameClientServerZKQuorum() throws Exception {
320320
master.join();
321321
}
322322

323-
@Test(timeout = 60000)
323+
@Test
324324
public void testMasterInitWithObserverModeClientZKQuorum() throws Exception {
325325
Configuration conf = new Configuration(TESTUTIL.getConfiguration());
326326
Assert.assertFalse(Boolean.getBoolean(HConstants.CLIENT_ZOOKEEPER_OBSERVER_MODE));

hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaState.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public void testQuotaStateUpdateTableThrottle() {
203203
assertNoopLimiter(quotaInfo.getTableLimiter(UNKNOWN_TABLE_NAME));
204204
}
205205

206-
@Test(timeout = 60000)
206+
@Test
207207
public void testTableThrottleWithBatch() {
208208
final TableName TABLE_A = TableName.valueOf("TableA");
209209
final int TABLE_A_THROTTLE_1 = 3;

hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestStoreHotnessProtector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class TestStoreHotnessProtector {
5353
@ClassRule public static final HBaseClassTestRule CLASS_RULE =
5454
HBaseClassTestRule.forClass(TestStoreHotnessProtector.class);
5555

56-
@Test(timeout = 60000)
56+
@Test
5757
public void testPreparePutCounter() throws Exception {
5858

5959
ExecutorService executorService = Executors.newFixedThreadPool(10);

hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3180,7 +3180,7 @@ public Object run() throws Exception {
31803180
verifyDenied(action, USER_CREATE, USER_RW, USER_RO, USER_NONE, USER_OWNER, USER_ADMIN);
31813181
}
31823182

3183-
@Test(timeout = 180000)
3183+
@Test
31843184
public void testGetUserPermissions() throws Throwable {
31853185
Connection conn = null;
31863186
try {
@@ -3308,7 +3308,7 @@ public void testGetUserPermissions() throws Throwable {
33083308
}
33093309
}
33103310

3311-
@Test(timeout = 180000)
3311+
@Test
33123312
public void testHasPermission() throws Throwable {
33133313
Connection conn = null;
33143314
try {

0 commit comments

Comments
 (0)