diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/FederationTestUtils.java b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/FederationTestUtils.java index 31c1bffe1e..5bd5178235 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/FederationTestUtils.java +++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/FederationTestUtils.java @@ -474,7 +474,10 @@ public static RouterClient getAdminClient( /** * Add a mount table entry in some name services and wait until it is - * available. + * available. If there are multiple routers, + * {@link #createMountTableEntry(List, String, DestinationOrder, Collection)} + * should be used instead because the method does not refresh + * the mount tables of the other routers. * @param router Router to change. * @param mountPoint Name of the mount point. * @param order Order of the mount table entry. diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterFaultTolerant.java b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterFaultTolerant.java index 5e0e117523..bf571e2ff7 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterFaultTolerant.java +++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterFaultTolerant.java @@ -248,6 +248,7 @@ private void testWriteWithFailedSubcluster(final DestinationOrder order) LOG.info("Setup {} with order {}", mountPoint, order); createMountTableEntry( getRandomRouter(), mountPoint, order, namenodes.keySet()); + refreshRoutersCaches(routers); LOG.info("Write in {} should succeed writing in ns0 and fail for ns1", mountPath);