Browse Source

HDFS-14742. RBF: TestRouterFaultTolerant tests are flaky

(cherry picked from commit e069a0613710926905de991d1d563cea5b4ee6df)
Akira Ajisaka 5 years ago
parent
commit
5459dd64fd

+ 4 - 1
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/FederationTestUtils.java

@@ -474,7 +474,10 @@ public final class FederationTestUtils {
 
   /**
    * 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.

+ 1 - 0
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterFaultTolerant.java

@@ -248,6 +248,7 @@ public class TestRouterFaultTolerant {
     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);