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

Hudson commented on HDFS-11831:
-------------------------------

SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #14070 (See 
[https://builds.apache.org/job/Hadoop-trunk-Commit/14070/])
HDFS-11831. Ozone: Improve the way of getting test file path in unit (omalley: 
rev 7f0be64284cff101459df83fe3d9e83932cda5d0)
* (edit) 
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestOzoneWebAccess.java
* (edit) 
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/client/TestBuckets.java
* (edit) 
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestLocalOzoneVolumes.java
* (edit) 
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestContainerPersistence.java
* (edit) 
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/container/TestContainerMapping.java
* (edit) 
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/cblock/TestCBlockServerPersistence.java
* (edit) 
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/block/TestBlockManager.java
* (edit) 
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/ozoneimpl/TestOzoneContainer.java
* (edit) 
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/client/TestKeys.java
* (edit) 
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/client/TestVolume.java


> Ozone: Improve the way of getting test file path in unit tests for Windows
> --------------------------------------------------------------------------
>
>                 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
>            Priority: Major
>             Fix For: HDFS-7240
>
>         Attachments: HDFS-11831-HDFS-7240.001.patch
>
>
> Found two test ({{TestContainerMapping}} and {{TestBlockManager}}) ran failed 
> in Windows caused by invalid test path generated. The stack info of one 
> failed test:
> {noformat}
> java.nio.file.InvalidPathException: Illegal char <:> at index 4: 
> file:/D:/Users/yiqun01.lin/.m2/repository/org/apache/hadoop/hadoop-common/3.0.0-alpha3-SNAPSHOT/hadoop-common-3.0.0-alpha3-SNAPSHOT.jar!/org/apache/hadoop/conf/TestContainerMapping
>       at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
>       at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
>       at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
>       at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
>       at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
>       at java.nio.file.Paths.get(Paths.java:84)
>       at 
> org.apache.hadoop.ozone.scm.block.TestBlockManager.setUp(TestBlockManager.java:68)
> {noformat}
> The similar issue 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 provided 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
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to