Ver código fonte

HADOOP-4403. Make TestLeaseRecovery and TestFileCreation more robust. (szetszwo)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.18@704612 13f79535-47bb-0310-9956-ffa450edef68
Tsz-wo Sze 16 anos atrás
pai
commit
ca33308770

+ 3 - 0
CHANGES.txt

@@ -23,6 +23,9 @@ Release 0.18.2 - Unreleased
 
     HADOOP-4407. HADOOP-4395 should use a Java 1.5 API for 0.18.  (szetszwo)
 
+    HADOOP-4403. Make TestLeaseRecovery and TestFileCreation more robust.
+    (szetszwo)
+
   NEW FEATURES
 
     HADOOP-2421.  Add jdiff output to documentation, listing all API

+ 0 - 5
src/test/org/apache/hadoop/dfs/TestFileCreation.java

@@ -199,7 +199,6 @@ public class TestFileCreation extends junit.framework.TestCase {
         assertEquals(SimulatedFSDataset.DEFAULT_CAPACITY-fileSize, dn.getFSDataset().getRemaining());
       }
     } finally {
-      fs.close();
       cluster.shutdown();
     }
   }
@@ -334,7 +333,6 @@ public class TestFileCreation extends junit.framework.TestCase {
       assertTrue("Error blocks were not cleaned up",
                  locations.locatedBlockCount() == 0);
     } finally {
-      fs.close();
       cluster.shutdown();
       client.close();
     }
@@ -583,9 +581,6 @@ public class TestFileCreation extends junit.framework.TestCase {
       assertTrue(file1 + " does not exist.", fs.exists(file1));
 
     } finally {
-      if (fs != null) {
-        fs.close();
-      }
       cluster.shutdown();
     }
   }

+ 1 - 0
src/test/org/apache/hadoop/dfs/TestLeaseRecovery.java

@@ -64,6 +64,7 @@ public class TestLeaseRecovery extends junit.framework.TestCase {
       Path filepath = new Path(filestr);
       DFSTestUtil.createFile(dfs, filepath, ORG_FILE_SIZE, REPLICATION_NUM, 0L);
       assertTrue(dfs.dfs.exists(filestr));
+      DFSTestUtil.waitReplication(dfs, filepath, REPLICATION_NUM);
 
       //get block info for the last block
       LocatedBlock locatedblock = TestInterDatanodeProtocol.getLastLocatedBlock(