[ 
https://issues.apache.org/jira/browse/HDFS-4586?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ivan Mitic updated HDFS-4586:
-----------------------------

    Attachment: HDFS-4586.trunk.patch

Attaching the patch.

The current version of mockito used in Hadoop does not support mocking of 
static methods. There is some controversy of adding this support in general (as 
discussed in HADOOP-8973) so this was not an option. Instead I abstracted out 
of DiskChecker static method into a wrapper object that allowed me to mock.

I believe this satisfies both the layering issue I mentioned above and is in 
line with guidelines around mocking. The downside is the additional of the new 
wrapper helper class. Please comment if you have suggestions for improvement.
                
> TestDataDirs.testGetDataDirsFromURIs fails with all directories in 
> dfs.datanode.data.dir are invalid
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-4586
>                 URL: https://issues.apache.org/jira/browse/HDFS-4586
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 3.0.0
>            Reporter: Ivan Mitic
>            Assignee: Ivan Mitic
>         Attachments: HDFS-4586.trunk.patch
>
>
> Error Message
> All directories in dfs.datanode.data.dir are invalid: "/p1" "/p2" "/p3" 
>  Stacktrace
> {code}
> java.io.IOException: All directories in dfs.datanode.data.dir are invalid: 
> "/p1" "/p2" "/p3" 
>       at 
> org.apache.hadoop.hdfs.server.datanode.DataNode.getDataDirsFromURIs(DataNode.java:1668)
>       at 
> org.apache.hadoop.hdfs.server.datanode.TestDataDirs.testGetDataDirsFromURIs(TestDataDirs.java:53)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> {code}
> Seems like Jenkins will return -1 on all HDFS patches because of this (check 
> HDFS-4583)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to