HDFS-13184. RBF: Improve the unit test TestRouterRPCClientRetries. Contributed by Yiqun Lin.

This commit is contained in:
Yiqun Lin 2018-02-27 10:48:52 +08:00
parent ae290a4bb4
commit 1e85a995d1
1 changed files with 10 additions and 1 deletions

View File

@ -25,6 +25,7 @@ import java.io.IOException;
import java.util.List; import java.util.List;
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.CommonConfigurationKeys;
import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.hdfs.DFSClient; import org.apache.hadoop.hdfs.DFSClient;
import org.apache.hadoop.hdfs.MiniDFSCluster; import org.apache.hadoop.hdfs.MiniDFSCluster;
@ -64,8 +65,16 @@ public class TestRouterRPCClientRetries {
.rpc() .rpc()
.build(); .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.addRouterOverrides(routerConf);
cluster.startCluster(); // override some settings for the client
cluster.startCluster(clientConf);
cluster.startRouters(); cluster.startRouters();
cluster.waitClusterUp(); cluster.waitClusterUp();