hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yufei Gu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-13380) TestBasicDiskValidator should not write data to /tmp
Date Fri, 15 Jul 2016 22:11:20 GMT

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

Yufei Gu commented on HADOOP-13380:
-----------------------------------

AFAIK, {{TestDiskChecker}} has the same problem, we should solve it as well. This issue may
exist in some other unit tests. Please report it if you find any. 

> TestBasicDiskValidator should not write data to /tmp
> ----------------------------------------------------
>
>                 Key: HADOOP-13380
>                 URL: https://issues.apache.org/jira/browse/HADOOP-13380
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 2.9.0
>            Reporter: Lei (Eddy) Xu
>            Assignee: Yufei Gu
>            Priority: Minor
>
> In {{TestBasicDiskValidator}}, the following code is confusing
> {code}
>    File localDir = File.createTempFile("test", "tmp");
> try {
>    if (isDir) {
>        // reuse the file path generated by File#createTempFile to create a dir
>       localDir.delete();
>        localDir.mkdir();
> }
> {code}
> Btw, as suggested in https://wiki.apache.org/hadoop/CodeReviewChecklist, unit test should
not write data into {{/tmp}}:
> bq. * unit tests do not write any temporary files to /tmp (instead, the tests should
write to the location specified by the test.build.data system property)
> Finally, should use {{Files}} in these file creation / deletion, so that any error can
be thrown as {{IOE}}.
>  



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

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


Mime
View raw message