Skip to content

Commit f42c89d

Browse files
authored
HDFS-16904. Close webhdfs during TestSymlinkHdfs teardown (#5372)
This is a followup to the original patch, 08f58ec, which it supercedes * Switch to org.apache.hadoop.io.IOUtils and closeStream. * Use cleanupWithLogger to include error logging Contributed by Steve Vaughan Jr
1 parent f3c4277 commit f42c89d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestSymlinkHdfs.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import java.io.IOException;
2424
import java.net.URI;
2525

26-
import org.apache.commons.io.IOUtils;
2726
import org.apache.hadoop.conf.Configuration;
2827
import org.apache.hadoop.fs.permission.FsPermission;
2928
import org.apache.hadoop.hdfs.DFSConfigKeys;
@@ -37,11 +36,14 @@
3736
import org.apache.hadoop.hdfs.web.WebHdfsConstants;
3837
import org.apache.hadoop.hdfs.web.WebHdfsFileSystem;
3938
import org.apache.hadoop.hdfs.web.WebHdfsTestUtil;
39+
import org.apache.hadoop.io.IOUtils;
4040
import org.apache.hadoop.ipc.RemoteException;
4141
import org.apache.hadoop.test.GenericTestUtils;
4242
import org.junit.AfterClass;
4343
import org.junit.BeforeClass;
4444
import org.junit.Test;
45+
import org.slf4j.Logger;
46+
import org.slf4j.LoggerFactory;
4547
import org.slf4j.event.Level;
4648

4749
/**
@@ -53,6 +55,9 @@ abstract public class TestSymlinkHdfs extends SymlinkBaseTest {
5355
GenericTestUtils.setLogLevel(NameNode.stateChangeLog, Level.TRACE);
5456
}
5557

58+
private static final Logger LOG = LoggerFactory.getLogger(
59+
TestSymlinkHdfs.class);
60+
5661
protected static MiniDFSCluster cluster;
5762
protected static WebHdfsFileSystem webhdfs;
5863
protected static DistributedFileSystem dfs;
@@ -100,7 +105,7 @@ public static void afterClassTeardown() throws Exception {
100105
if (cluster != null) {
101106
cluster.shutdown();
102107
}
103-
IOUtils.closeQuietly(webhdfs);
108+
IOUtils.cleanupWithLogger(LOG, webhdfs);
104109
}
105110

106111
@Test(timeout=10000)

0 commit comments

Comments
 (0)