lzx404243 opened a new pull request #2724: URL: https://github.com/apache/hadoop/pull/2724
The test `org.apache.hadoop.hdfs.nfs.nfs3.TestViewfsWithNfs3.testNfsRenameSingleNN` is not idempotent and fails if run twice in the same JVM, because it pollutes state shared among tests. It may be good to clean this state pollution so that some other tests do not fail in the future due to the shared state polluted by this test. ### Details Running `TestViewfsWithNfs3.testNfsRenameSingleNN` twice would result in the second run failing with the a NullPointer exception: ``` [ERROR] Errors: [ERROR] TestViewfsWithNfs3.testNfsRenameSingleNN:317 NullPointer ``` The reason for this is that the `/user1/renameSingleNN` file is created in `setup()`, but gets renamed in`testNfsRenameSingleNN`. When the second run of `testNfsRenameSingleNN` tries to get info of the file by its original name, it returns a NullPointer since the file no longer exists. The fix for this is to rename the file back to the original when the test is done. With the proposed fix, the test does not pollute the shared state (and passes when run twice in the same JVM). Link to JIRA issue: https://issues.apache.org/jira/browse/HDFS-15862 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
