hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yiqun Lin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-11831) Ozone: Improve the way of getting test file path in unit tests
Date Tue, 16 May 2017 11:15:04 GMT

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

Yiqun Lin commented on HDFS-11831:
----------------------------------

Attach the initial patch. Kindly review.

> Ozone: Improve the way of getting test file path in unit tests
> --------------------------------------------------------------
>
>                 Key: HDFS-11831
>                 URL: https://issues.apache.org/jira/browse/HDFS-11831
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: ozone
>    Affects Versions: HDFS-7240
>            Reporter: Yiqun Lin
>            Assignee: Yiqun Lin
>         Attachments: HDFS-11831-HDFS-7240.001.patch
>
>
> Found two test failures({{TestContainerMapping}} and {{TestBlockManager}}) caused by
invalid test path generated. The root caused has been analysed in HDFS-11619.
> The related codes:
> {noformat}
> URL p = conf.getClass().getResource("");
> String path = p.getPath().concat(...));
> {noformat}
> We would be better not to use the this way to get a test path since it will get a incorrect
path when the OS env is Windows. Although sometimes the wrong path can be corrected by normalize
method in File class. But in some other cases, example in {{Paths.get(path).toFile()}}, the
wrong path will lead the failure.
> Actually in COMMON, it has already supply some utility methods to help us get the valid
test file/path in unit testing. We could use this to replace the old way.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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


Mime
View raw message