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

Xiaoyu Yao commented on HDFS-13251:
-----------------------------------

[~ajayydv] , thanks for the update. The new patch looks pretty good to me. Just 
have a few more comments:

 

*TestDataNodeHotSwapVolumes.java*

Line 698/715/716 changes can be skipped

As long as it does not change the standard MiniDFSCluster locations, Let's just 
keep it as-is.

 

*TestDataNodeVolumeFailureReporting.java*

Line 81/780: unused dataDir can be removed

 

*TestDataNodeVolumeFailureToleration.java*

{color:#000000}testValidVolumesAtStartup() change can be skipped. 
{color}{color:#808080}(non-standard locations){color}

 

*TestDFSAdmin.java*

testDataNodeGetReconfigurationStatus() change can be skipped. (non-standard 
locations)

 

Line 322-329, suggested changes:

{code}

File dnDir0 = cluster.getInstanceStorageDir(0, 0);
File dnDir1 = cluster.getInstanceStorageDir(0, 1);
assertThat(outs.get(offset + 1), is(allOf(containsString("From:"),
                    containsString(dnDir0.getName()),
                    containsString(dnDir1.getName()))));
assertThat(outs.get(offset + 2),
        is(not(anyOf(containsString(dnDir0.getName()),
             containsString(dnDir1.getName())))));

{code}

 

> Avoid using hard coded datanode data dirs in unit tests
> -------------------------------------------------------
>
>                 Key: HDFS-13251
>                 URL: https://issues.apache.org/jira/browse/HDFS-13251
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: test
>            Reporter: Xiaoyu Yao
>            Assignee: Ajay Kumar
>            Priority: Major
>         Attachments: HDFS-13251.000.patch, HDFS-13251.001.patch, 
> HDFS-13251.002.patch
>
>
> There are a few unit tests that rely on hard-coded MiniDFSCluster data dir 
> names.
>  
>  * TestDataNodeVolumeFailureToleration
>  * TestDataNodeVolumeFailureReporting
>  * TestDiskBalancerCommand
>  * TestBlockStatsMXBean
>  * TestDataNodeVolumeMetrics
>  * TestDFSAdmin
>  * TestDataNodeHotSwapVolumes
>  * TestDataNodeVolumeFailure
> This ticket is opened to use
> {code:java}
> MiniDFSCluster#getInstanceStorageDir(0, 1);
> instead of like below
> new File(cluster.getDataDirectory(), "data1");{code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to