Browse Source

HDFS-5879. Some TestHftpFileSystem tests do not close streams. Contributed by Gera Shegalov.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1567704 13f79535-47bb-0310-9956-ffa450edef68
Suresh Srinivas 11 năm trước cách đây
mục cha
commit
5efc9978dd

+ 3 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -416,6 +416,9 @@ Release 2.4.0 - UNRELEASED
     HDFS-4858. HDFS DataNode to NameNode RPC should timeout.
     (Henry Wang via shv)
 
+    HDFS-5879. Some TestHftpFileSystem tests do not close streams.
+    (Gera Shegalov via suresh)
+
 Release 2.3.1 - UNRELEASED
 
   INCOMPATIBLE CHANGES

+ 2 - 0
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestHftpFileSystem.java

@@ -136,6 +136,7 @@ public class TestHftpFileSystem {
       out.close();
       FSDataInputStream in = hftpFs.open(p);
       assertEquals('0', in.read());
+      in.close();
 
       // Check the file status matches the path. Hftp returns a FileStatus
       // with the entire URI, extract the path part.
@@ -250,6 +251,7 @@ public class TestHftpFileSystem {
     FSDataInputStream in = hftpFs.open(testFile);
     in.seek(7);
     assertEquals('7', in.read());
+    in.close();
   }
 
   @Test