goiri commented on a change in pull request #2993:
URL: https://github.com/apache/hadoop/pull/2993#discussion_r629504887



##########
File path: 
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterRpc.java
##########
@@ -513,6 +513,44 @@ public void testProxyListFilesLargeDir() throws 
IOException {
     }
   }
 
+  @Test
+  public void testProxyListFilesWithOverwrite() throws IOException {
+    // Create a parent point as well as a subfolder mount
+    // /parent
+    //    ns0 -> /parent
+    // /parent/sub1
+    //    ns0 -> /parent/sub1
+    String parent = "/parent";
+    String sub1 = parent + "/sub1";
+    Path parentPath = new Path(parent);
+    // Add mount point
+    for (RouterContext rc : cluster.getRouters()) {
+      MockResolver resolver =
+          (MockResolver) rc.getRouter().getSubclusterResolver();
+      resolver.addLocation(parent, ns, parent);
+      resolver.addLocation(sub1, ns, sub1);
+    }
+    // The sub1 folder created is the same as the sub1 mount point directory
+    nnFS.mkdirs(new Path(sub1));
+
+    FileStatus[] routerFsResult = routerFS.listStatus(parentPath);
+    FileStatus[] nnFsResult = nnFS.listStatus(parentPath);
+    // Checking
+    assertEquals(1, routerFsResult.length);
+    assertEquals(1, nnFsResult.length);
+
+    FileStatus nnFileStatus = nnFsResult[0];
+    FileStatus routerFileStatus = routerFsResult[0];
+
+    assert nnFileStatus != null;

Review comment:
       Let's do a unit test assert instead.




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

Reply via email to