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

Mingliang Liu updated HDFS-10415:
---------------------------------
    Attachment: HDFS-10415-branch-2.000.patch

Thanks for reporting this [~sjlee0] and [~ste...@apache.org].

I think the problem was that, we added a new {{StorageStatistics}} object in 
[HADOOP-13065] to {{DistributedFileSystem}} and it needs initialized in the 
{{initialize()}} method. In the test, we simply create a new instance by 
calling constructor, in which way the {{initialize()}} method is not called,  
instead of using the factory methods like {{FileSystem#get()}}.

As a fix, I see two possibilities:
# Call the {{initialize()}} method explicitly before mocking the {{dfs}} field. 
This way, the newly added {{StorageStatistics}} object will be initialized 
before using it.
# For the {{InOrder}} unit test, actually we can use the spied objects other 
than mocked objects. This way, we don't need to create our test file system 
{{MyDistributedFileSystem}}.

I prefer the 2nd option as v0 patch does.

> TestDistributedFileSystem#testDFSCloseOrdering() fails on branch-2
> ------------------------------------------------------------------
>
>                 Key: HDFS-10415
>                 URL: https://issues.apache.org/jira/browse/HDFS-10415
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: test
>    Affects Versions: 2.9.0
>         Environment: jenkins
>            Reporter: Sangjin Lee
>            Assignee: Mingliang Liu
>         Attachments: HDFS-10415-branch-2.000.patch
>
>
> {noformat}
> Tests run: 24, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 51.096 sec 
> <<< FAILURE! - in org.apache.hadoop.hdfs.TestDistributedFileSystem
> testDFSCloseOrdering(org.apache.hadoop.hdfs.TestDistributedFileSystem)  Time 
> elapsed: 0.045 sec  <<< ERROR!
> java.lang.NullPointerException: null
>       at 
> org.apache.hadoop.hdfs.DistributedFileSystem.delete(DistributedFileSystem.java:790)
>       at 
> org.apache.hadoop.fs.FileSystem.processDeleteOnExit(FileSystem.java:1417)
>       at org.apache.hadoop.fs.FileSystem.close(FileSystem.java:2084)
>       at 
> org.apache.hadoop.hdfs.DistributedFileSystem.close(DistributedFileSystem.java:1187)
>       at 
> org.apache.hadoop.hdfs.TestDistributedFileSystem.testDFSCloseOrdering(TestDistributedFileSystem.java:217)
> {noformat}
> This is with Java 8 on Mac. It passes fine on trunk. I haven't tried other 
> combinations. 



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

---------------------------------------------------------------------
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