hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1587366 - in /hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase: master/cleaner/TestLogsCleaner.java regionserver/TestSplitLogWorker.java
Date Tue, 15 Apr 2014 00:03:28 GMT
Author: stack
Date: Tue Apr 15 00:03:28 2014
New Revision: 1587366

URL: http://svn.apache.org/r1587366
Log:
HBASE-10543 Two rare test failures with TestLogsCleaner and TestSplitLogWorker

Modified:
    hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestLogsCleaner.java
    hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitLogWorker.java

Modified: hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestLogsCleaner.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestLogsCleaner.java?rev=1587366&r1=1587365&r2=1587366&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestLogsCleaner.java
(original)
+++ hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestLogsCleaner.java
Tue Apr 15 00:03:28 2014
@@ -70,13 +70,12 @@ public class TestLogsCleaner {
     ReplicationQueues repQueues =
         ReplicationFactory.getReplicationQueues(server.getZooKeeper(), conf, server);
     repQueues.init(server.getServerName().toString());
-    Path oldLogDir = new Path(TEST_UTIL.getDataTestDir(),
+    final Path oldLogDir = new Path(TEST_UTIL.getDataTestDir(),
         HConstants.HREGION_OLDLOGDIR_NAME);
     String fakeMachineName =
       URLEncoder.encode(server.getServerName().toString(), "UTF8");
 
-    FileSystem fs = FileSystem.get(conf);
-    LogCleaner cleaner  = new LogCleaner(1000, server, conf, fs, oldLogDir);
+    final FileSystem fs = FileSystem.get(conf);
 
     // Create 2 invalid files, 1 "recent" file, 1 very new file and 30 old files
     long now = System.currentTimeMillis();
@@ -117,11 +116,17 @@ public class TestLogsCleaner {
 
     assertEquals(34, fs.listStatus(oldLogDir).length);
 
+    LogCleaner cleaner  = new LogCleaner(1000, server, conf, fs, oldLogDir);
     cleaner.chore();
 
     // We end up with the current log file, a newer one and the 3 old log
     // files which are scheduled for replication
-    assertEquals(5, fs.listStatus(oldLogDir).length);
+    TEST_UTIL.waitFor(1000, new Waiter.Predicate<Exception>() {
+      @Override
+      public boolean evaluate() throws Exception {
+        return 5 == fs.listStatus(oldLogDir).length;
+      }
+    });
 
     for (FileStatus file : fs.listStatus(oldLogDir)) {
       System.out.println("Kept log files: " + file.getPath().getName());

Modified: hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitLogWorker.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitLogWorker.java?rev=1587366&r1=1587365&r2=1587366&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitLogWorker.java
(original)
+++ hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitLogWorker.java
Tue Apr 15 00:03:28 2014
@@ -235,7 +235,7 @@ public class TestSplitLogWorker {
       byte [] bytes = ZKUtil.getData(zkw, PATH);
       SplitLogTask slt = SplitLogTask.parseFrom(bytes);
       assertTrue(slt.isOwned(SRV));
-      slt = new SplitLogTask.Unassigned(MANAGER);
+      slt = new SplitLogTask.Owned(MANAGER);
       ZKUtil.setData(zkw, PATH, slt.toByteArray());
       waitForCounter(SplitLogCounters.tot_wkr_preempt_task, 0, 1, WAIT_TIME);
     } finally {



Mime
View raw message