From 09017aee903bed4d09918b6176757d30a8cd3b03 Mon Sep 17 00:00:00 2001 From: Yiqun Lin Date: Tue, 27 Feb 2018 10:48:52 +0800 Subject: [PATCH] HDFS-13184. RBF: Improve the unit test TestRouterRPCClientRetries. Contributed by Yiqun Lin. (cherry picked from commit 1e85a995d1c7fe3dbf4b36a481feb5fdeeb6015b) --- .../federation/router/TestRouterRPCClientRetries.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterRPCClientRetries.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterRPCClientRetries.java index dddcb5a9a5e..61e7657a75d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterRPCClientRetries.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterRPCClientRetries.java @@ -25,6 +25,7 @@ import java.io.IOException; import java.util.List; import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.CommonConfigurationKeys; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.hdfs.DFSClient; import org.apache.hadoop.hdfs.MiniDFSCluster; @@ -64,8 +65,16 @@ public class TestRouterRPCClientRetries { .rpc() .build(); + // reduce IPC client connection retry times and interval time + Configuration clientConf = new Configuration(false); + clientConf.setInt( + CommonConfigurationKeys.IPC_CLIENT_CONNECT_MAX_RETRIES_KEY, 1); + clientConf.setInt( + CommonConfigurationKeys.IPC_CLIENT_CONNECT_RETRY_INTERVAL_KEY, 100); + cluster.addRouterOverrides(routerConf); - cluster.startCluster(); + // override some settings for the client + cluster.startCluster(clientConf); cluster.startRouters(); cluster.waitClusterUp();