aajisaka commented on a change in pull request #2724:
URL: https://github.com/apache/hadoop/pull/2724#discussion_r700048007



##########
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:
       You don't need to check if the file exists. Just calling delete is 
sufficient:
   
https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-common/filesystem/filesystem.html#boolean_delete.28Path_p.2C_boolean_recursive.29




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to