[ 
https://issues.apache.org/jira/browse/HDFS-15862?focusedWorklogId=681169&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-681169
 ]

ASF GitHub Bot logged work on HDFS-15862:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/Nov/21 22:31
            Start Date: 13/Nov/21 22:31
    Worklog Time Spent: 10m 
      Work Description: lzx404243 commented on a change in pull request #2724:
URL: https://github.com/apache/hadoop/pull/2724#discussion_r748772830



##########
File path: 
hadoop-hdfs-project/hadoop-hdfs-nfs/src/test/java/org/apache/hadoop/hdfs/nfs/nfs3/TestViewfsWithNfs3.java
##########
@@ -316,6 +316,10 @@ public void testNfsRenameSingleNN() throws Exception {
         nn1.getRpcServer().getFileInfo("/user1/renameSingleNN");
     Assert.assertEquals(statusBeforeRename.isDirectory(), false);
 
+    Path successFilePath = new Path("/user1/renameSingleNNSucess");
+    if (hdfs1.exists(successFilePath)) {
+      hdfs1.delete(successFilePath, false);
+    }

Review comment:
       Thanks @aajisaka for pointing that out! Updated the fix.




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

To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 681169)
    Time Spent: 1h 20m  (was: 1h 10m)

> Rename file back to original in TestViewfsWithNfs3.testNfsRenameSingleNN
> ------------------------------------------------------------------------
>
>                 Key: HDFS-15862
>                 URL: https://issues.apache.org/jira/browse/HDFS-15862
>             Project: Hadoop HDFS
>          Issue Type: Test
>            Reporter: Zhengxi Li
>            Assignee: Zhengxi Li
>            Priority: Minor
>              Labels: pull-request-available
>         Attachments: HDFS-15862.001.patch, HDFS-15862.002.patch
>
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> The 
> 'org.apache.hadoop.hdfs.nfs.nfs3.TestViewfsWithNfs3.testNfsRenameSingleNN' 
> test 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.
> Running {{TestViewfsWithNfs3.testNfsRenameSingleNN}} twice would result in 
> the second run failing with a NullPointer exception:
> {noformat}
> [ERROR] Errors:
> [ERROR]   TestViewfsWithNfs3.testNfsRenameSingleNN:317 NullPointer
> {noformat}
> The reason for this is that the {{/user1/renameSingleNN}} file is created in 
> {{setup()}}, but gets renamed in {{testNfsRenameSingl{{eNN}}}}. 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.
>  
> Link to PR: https://github.com/apache/hadoop/pull/2724



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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