hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r1148591 - /hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestEditLogFileOutputStream.java
Date Wed, 20 Jul 2011 00:59:37 GMT
Author: todd
Date: Wed Jul 20 00:59:37 2011
New Revision: 1148591

URL: http://svn.apache.org/viewvc?rev=1148591&view=rev
Log:
Small tweak to TestEditLogFileOutputStream to pass on hudson box.

Previously depended on the exact length of a mkdirs op, which is
dependent on the username running the test.

Modified:
    hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestEditLogFileOutputStream.java

Modified: hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestEditLogFileOutputStream.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestEditLogFileOutputStream.java?rev=1148591&r1=1148590&r2=1148591&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestEditLogFileOutputStream.java
(original)
+++ hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestEditLogFileOutputStream.java
Wed Jul 20 00:59:37 2011
@@ -42,7 +42,6 @@ import org.mockito.Mockito;
 public class TestEditLogFileOutputStream {
   
   private final static int HEADER_LEN = 17;
-  private final static int MKDIR_LEN = 59;
   private static final File TEST_EDITS =
     new File(System.getProperty("test.build.data","/tmp"),
              "editLogStream.dat");
@@ -73,10 +72,11 @@ public class TestEditLogFileOutputStream
     cluster.getFileSystem().mkdirs(new Path("/tmp"),
         new FsPermission((short)777));
 
+    long oldLength = validation.validLength;
     validation = FSEditLogLoader.validateEditLog(editLog);
-    assertEquals("Edit log should have more valid data after writing a txn",
-        MKDIR_LEN + HEADER_LEN,
-        validation.validLength);
+    assertTrue("Edit log should have more valid data after writing a txn " +
+        "(was: " + oldLength + " now: " + validation.validLength + ")",
+        validation.validLength > oldLength);
     assertEquals(2, validation.numTransactions);
 
     assertEquals("Edit log should be 1MB long",



Mime
View raw message