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

(cherry picked from commit c68dad18ab)
This commit is contained in:
Brahma Reddy Battula 2016-11-21 10:58:34 +05:30
parent d29e3d0f52
commit f3649deca5
1 changed files with 3 additions and 8 deletions

View File

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