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 2013/07/22 23:05:59 UTC

svn commit: r1505817 - /hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogSplit.java

Author: stack
Date: Mon Jul 22 21:05:59 2013
New Revision: 1505817

URL: http://svn.apache.org/r1505817
Log:
HBASE-9018 Add timeouts on all tests in TestHLogSplit

Modified:
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogSplit.java

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogSplit.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogSplit.java?rev=1505817&r1=1505816&r2=1505817&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogSplit.java (original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogSplit.java Mon Jul 22 21:05:59 2013
@@ -187,7 +187,7 @@ public class TestHLogSplit {
    * @throws IOException
    * @throws InterruptedException
    */
-  @Test
+  @Test (timeout=300000)
   public void testLogCannotBeWrittenOnceParsed() throws IOException, InterruptedException {
     final AtomicLong counter = new AtomicLong(0);
     AtomicBoolean stop = new AtomicBoolean(false);
@@ -332,7 +332,7 @@ public class TestHLogSplit {
    * @throws IOException
    * @see https://issues.apache.org/jira/browse/HBASE-3020
    */
-  @Test
+  @Test (timeout=300000)
   public void testRecoveredEditsPathForMeta() throws IOException {
     FileSystem fs = FileSystem.get(TEST_UTIL.getConfiguration());
     byte [] encoded = HRegionInfo.FIRST_META_REGIONINFO.getEncodedNameAsBytes();
@@ -354,7 +354,7 @@ public class TestHLogSplit {
    * Test old recovered edits file doesn't break HLogSplitter.
    * This is useful in upgrading old instances.
    */
-  @Test
+  @Test (timeout=300000)
   public void testOldRecoveredEditsFileSidelined() throws IOException {
     FileSystem fs = FileSystem.get(TEST_UTIL.getConfiguration());
     byte [] encoded = HRegionInfo.FIRST_META_REGIONINFO.getEncodedNameAsBytes();
@@ -377,7 +377,7 @@ public class TestHLogSplit {
     HLogFactory.createWriter(fs, p, conf).close();
   }
 
-  @Test
+  @Test (timeout=300000)
   public void testSplitPreservesEdits() throws IOException{
     final String REGION = "region__1";
     REGIONS.removeAll(REGIONS);
@@ -394,7 +394,7 @@ public class TestHLogSplit {
   }
 
 
-  @Test
+  @Test (timeout=300000)
   public void testEmptyLogFiles() throws IOException {
 
     injectEmptyFile(".empty", true);
@@ -419,7 +419,7 @@ public class TestHLogSplit {
   }
 
 
-  @Test
+  @Test (timeout=300000)
   public void testEmptyOpenLogFiles() throws IOException {
     injectEmptyFile(".empty", false);
     generateHLogs(Integer.MAX_VALUE);
@@ -442,7 +442,7 @@ public class TestHLogSplit {
     }
   }
 
-  @Test
+  @Test (timeout=300000)
   public void testOpenZeroLengthReportedFileButWithDataGetsSplit() throws IOException {
     // generate logs but leave hlog.dat.5 open.
     generateHLogs(5);
@@ -463,7 +463,7 @@ public class TestHLogSplit {
   }
 
 
-  @Test
+  @Test (timeout=300000)
   public void testTralingGarbageCorruptionFileSkipErrorsPasses() throws IOException {
     conf.setBoolean(HBASE_SKIP_ERRORS, true);
     generateHLogs(Integer.MAX_VALUE);
@@ -484,7 +484,7 @@ public class TestHLogSplit {
     }
   }
 
-  @Test
+  @Test (timeout=300000)
   public void testFirstLineCorruptionLogFileSkipErrorsPasses() throws IOException {
     conf.setBoolean(HBASE_SKIP_ERRORS, true);
     generateHLogs(Integer.MAX_VALUE);
@@ -505,7 +505,7 @@ public class TestHLogSplit {
     }
   }
 
-  @Test
+  @Test (timeout=300000)
   public void testMiddleGarbageCorruptionSkipErrorsReadsHalfOfFile() throws IOException {
     conf.setBoolean(HBASE_SKIP_ERRORS, true);
     generateHLogs(Integer.MAX_VALUE);
@@ -532,7 +532,7 @@ public class TestHLogSplit {
     }
   }
 
-  @Test
+  @Test (timeout=300000)
   public void testCorruptedFileGetsArchivedIfSkipErrors() throws IOException {
     conf.setBoolean(HBASE_SKIP_ERRORS, true);
     Class<?> backupClass = conf.getClass("hbase.regionserver.hlog.reader.impl",
@@ -562,7 +562,7 @@ public class TestHLogSplit {
     }
   }
 
-  @Test(expected = IOException.class)
+  @Test (timeout=300000, expected = IOException.class)
   public void testTrailingGarbageCorruptionLogFileSkipErrorsFalseThrows()
       throws IOException {
     conf.setBoolean(HBASE_SKIP_ERRORS, false);
@@ -585,7 +585,7 @@ public class TestHLogSplit {
     }
   }
 
-  @Test
+  @Test (timeout=300000)
   public void testCorruptedLogFilesSkipErrorsFalseDoesNotTouchLogs()
       throws IOException {
     conf.setBoolean(HBASE_SKIP_ERRORS, false);
@@ -614,7 +614,7 @@ public class TestHLogSplit {
     }
   }
 
-  @Test
+  @Test (timeout=300000)
   public void testEOFisIgnored() throws IOException {
     conf.setBoolean(HBASE_SKIP_ERRORS, false);
 
@@ -645,7 +645,7 @@ public class TestHLogSplit {
     assertEquals(archivedLogs.length, 0);
   }
 
-  @Test
+  @Test (timeout=300000)
   public void testCorruptWALTrailer() throws IOException {
     conf.setBoolean(HBASE_SKIP_ERRORS, false);
 
@@ -676,7 +676,7 @@ public class TestHLogSplit {
     assertEquals(archivedLogs.length, 0);
   }
 
-  @Test
+  @Test (timeout=300000)
   public void testLogsGetArchivedAfterSplit() throws IOException {
     conf.setBoolean(HBASE_SKIP_ERRORS, false);
     generateHLogs(-1);
@@ -686,7 +686,7 @@ public class TestHLogSplit {
     assertEquals("wrong number of files in the archive log", NUM_WRITERS, archivedLogs.length);
   }
 
-  @Test
+  @Test (timeout=300000)
   public void testSplit() throws IOException {
     generateHLogs(-1);
     fs.initialize(fs.getUri(), conf);
@@ -704,7 +704,7 @@ public class TestHLogSplit {
     }
   }
 
-  @Test
+  @Test (timeout=300000)
   public void testLogDirectoryShouldBeDeletedAfterSuccessfulSplit()
   throws IOException {
     generateHLogs(-1);
@@ -722,7 +722,7 @@ public class TestHLogSplit {
     }
   }
 
-  @Test(expected = IOException.class)
+  @Test(timeout=300000, expected = IOException.class)
   public void testSplitWillFailIfWritingToRegionFails() throws Exception {
     //leave 5th log open so we could append the "trap"
     HLog.Writer [] writer = generateHLogs(4);
@@ -775,7 +775,7 @@ public class TestHLogSplit {
     assertEquals(0, compareHLogSplitDirs(firstSplitPath, splitPath));
   }
 
-  @Test
+  @Test (timeout=300000)
   public void testSplitDeletedRegion() throws IOException {
     REGIONS.removeAll(REGIONS);
     String region = "region_that_splits";
@@ -790,7 +790,7 @@ public class TestHLogSplit {
     assertFalse(fs.exists(regiondir));
   }
 
-  @Test
+  @Test (timeout=300000)
   public void testIOEOnOutputThread() throws Exception {
     conf.setBoolean(HBASE_SKIP_ERRORS, false);
 
@@ -819,7 +819,7 @@ public class TestHLogSplit {
   }
 
   // Test for HBASE-3412
-  @Test
+  @Test (timeout=300000)
   public void testMovedHLogDuringRecovery() throws Exception {
     generateHLogs(-1);
 
@@ -842,7 +842,7 @@ public class TestHLogSplit {
     }
   }
 
-  @Test
+  @Test (timeout=300000)
   public void testRetryOpenDuringRecovery() throws Exception {
     generateHLogs(-1);
 
@@ -881,7 +881,7 @@ public class TestHLogSplit {
     }
   }
 
-  @Test
+  @Test (timeout=300000)
   public void testTerminationAskedByReporter() throws IOException, CorruptedLogFileException {
     generateHLogs(1, 10, -1);
     FileStatus logfile = fs.listStatus(HLOGDIR)[0];
@@ -924,7 +924,7 @@ public class TestHLogSplit {
    * Test log split process with fake data and lots of edits to trigger threading
    * issues.
    */
-  @Test
+  @Test (timeout=300000)
   public void testThreading() throws Exception {
     doTestThreading(20000, 128*1024*1024, 0);
   }
@@ -933,7 +933,7 @@ public class TestHLogSplit {
    * Test blocking behavior of the log split process if writers are writing slower
    * than the reader is reading.
    */
-  @Test
+  @Test (timeout=300000)
   public void testThreadingSlowWriterSmallBuffer() throws Exception {
     doTestThreading(200, 1024, 50);
   }
@@ -1042,7 +1042,7 @@ public class TestHLogSplit {
   // HBASE-2312: tests the case where a RegionServer enters a GC pause,
   // comes back online after the master declared it dead and started to split.
   // Want log rolling after a master split to fail
-  @Test
+  @Test (timeout=300000)
   @Ignore("Need HADOOP-6886, HADOOP-6840, & HDFS-617 for this. HDFS 0.20.205.1+ should have this")
   public void testLogRollAfterSplitStart() throws IOException {
     // set flush interval to a large number so it doesn't interrupt us
@@ -1152,7 +1152,7 @@ public class TestHLogSplit {
     }
   }
 
-  @Test
+  @Test (timeout=300000)
   public void testSplitLogFileWithOneRegion() throws IOException {
     LOG.info("testSplitLogFileWithOneRegion");
     final String REGION = "region__1";
@@ -1170,7 +1170,7 @@ public class TestHLogSplit {
     assertEquals(true, logsAreEqual(originalLog, splitLog[0]));
   }
 
-  @Test
+  @Test (timeout=300000)
   public void testSplitLogFileDeletedRegionDir() throws IOException {
     LOG.info("testSplitLogFileDeletedRegionDir");
     final String REGION = "region__1";
@@ -1190,7 +1190,7 @@ public class TestHLogSplit {
     assertTrue(true);
   }
 
-  @Test
+  @Test (timeout=300000)
   public void testSplitLogFileEmpty() throws IOException {
     LOG.info("testSplitLogFileEmpty");
     injectEmptyFile(".empty", true);
@@ -1204,7 +1204,7 @@ public class TestHLogSplit {
     assertEquals(0, countHLog(fs.listStatus(OLDLOGDIR)[0].getPath(), fs, conf));
   }
 
-  @Test
+  @Test (timeout=300000)
   public void testSplitLogFileMultipleRegions() throws IOException {
     LOG.info("testSplitLogFileMultipleRegions");
     generateHLogs(1, 10, -1);
@@ -1218,7 +1218,7 @@ public class TestHLogSplit {
     }
   }
 
-  @Test
+  @Test (timeout=300000)
   public void testSplitLogFileFirstLineCorruptionLog()
   throws IOException {
     conf.setBoolean(HBASE_SKIP_ERRORS, true);
@@ -1240,7 +1240,7 @@ public class TestHLogSplit {
    * @throws IOException
    * @see https://issues.apache.org/jira/browse/HBASE-4862
    */
-  @Test
+  @Test (timeout=300000)
   public void testConcurrentSplitLogAndReplayRecoverEdit() throws IOException {
     LOG.info("testConcurrentSplitLogAndReplayRecoverEdit");
     // Generate hlogs for our destination region