فهرست منبع

HDFS-11144. TestFileCreationDelete#testFileCreationDeleteParent fails wind bind exception. Contributed By Brahma Reddy Battula.

Brahma Reddy Battula 8 سال پیش
والد
کامیت
c68dad18ab

+ 3 - 8
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFileCreationDelete.java

@@ -46,7 +46,6 @@ public class TestFileCreationDelete {
     try {
       cluster.waitActive();
       fs = cluster.getFileSystem();
-      final int nnport = cluster.getNameNodePort();
 
       // create file1.
       Path dir = new Path("/foo");
@@ -68,22 +67,18 @@ public class TestFileCreationDelete {
       // rm dir
       fs.delete(dir, true);
 
-      // restart cluster with the same namenode port as before.
+      // restart cluster.
       // This ensures that leases are persisted in fsimage.
       cluster.shutdown();
       try {Thread.sleep(2*MAX_IDLE_TIME);} catch (InterruptedException e) {}
-      cluster = new MiniDFSCluster.Builder(conf).nameNodePort(nnport)
-                                                .format(false)
-                                                .build();
+      cluster = new MiniDFSCluster.Builder(conf).format(false).build();
       cluster.waitActive();
 
       // restart cluster yet again. This triggers the code to read in
       // persistent leases from fsimage.
       cluster.shutdown();
       try {Thread.sleep(5000);} catch (InterruptedException e) {}
-      cluster = new MiniDFSCluster.Builder(conf).nameNodePort(nnport)
-                                                .format(false)
-                                                .build();
+      cluster = new MiniDFSCluster.Builder(conf).format(false).build();
       cluster.waitActive();
       fs = cluster.getFileSystem();