hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tsz Wo Nicholas Sze (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-12984) Add GenericTestUtils.getTestDir method and use it for temporary directory in tests
Date Thu, 07 Apr 2016 06:39:25 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-12984?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15229783#comment-15229783
] 

Tsz Wo Nicholas Sze commented on HADOOP-12984:
----------------------------------------------

No problem.  Below is a suggested fix.
{code}
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFileUtil.java
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFileUtil.java
index c478681..76ccb75 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFileUtil.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFileUtil.java
@@ -566,8 +566,8 @@ private boolean copyMerge(String src, String dst)
     final boolean result;
 
     try {
-      Path srcPath = new Path(TEST_ROOT_DIR, src);
-      Path dstPath = new Path(TEST_ROOT_DIR, dst);
+      Path srcPath = new Path(TEST_DIR.toString(), src);
+      Path dstPath = new Path(TEST_DIR.toString(), dst);
       boolean deleteSource = false;
       String addString = null;
       result = FileUtil.copyMerge(fs, srcPath, fs, dstPath, deleteSource, conf,
{code}


> Add GenericTestUtils.getTestDir method and use it for temporary directory in tests
> ----------------------------------------------------------------------------------
>
>                 Key: HADOOP-12984
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12984
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: build, test
>    Affects Versions: 3.0.0
>            Reporter: Steve Loughran
>            Assignee: Steve Loughran
>             Fix For: 2.9.0
>
>         Attachments: HADOOP-12984-003.patch, HDFS-9263-001.patch, HDFS-9263-002.patch,
HDFS-9263-003.patch
>
>
> We have seen some tests had been used the path {{test/build/data}} to store files, so
leaking files which fail the new post-build RAT test checks on Jenkins (and dirtying all development
systems with paths which {{mvn clean}} will miss.
> In order not to occur these bugs such as MAPREDUCE-6589 and HDFS-9571 again, we'd like
to introduce new utility methods to get a temporary directory path easily, and use the methods
in tests.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message