瀏覽代碼

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.


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-1073@1148591 13f79535-47bb-0310-9956-ffa450edef68
Todd Lipcon 14 年之前
父節點
當前提交
0e3a9837aa

+ 4 - 4
hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestEditLogFileOutputStream.java

@@ -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",