HDFS-16140. TestBootstrapAliasmap fails by BindException. (#3229)

Reviewed-by: Hui Fei <ferhui@apache.org>
(cherry picked from commit d710ec8d85)
This commit is contained in:
Akira Ajisaka 2021-07-26 16:46:07 +09:00
parent e533efc58e
commit 9e72b697a2
No known key found for this signature in database
GPG Key ID: C1EDBB9CA400FD50

View File

@ -51,6 +51,9 @@ public class TestBootstrapAliasmap {
public void setup() throws Exception { public void setup() throws Exception {
Configuration conf = new Configuration(); Configuration conf = new Configuration();
MiniDFSCluster.setupNamenodeProvidedConfiguration(conf); MiniDFSCluster.setupNamenodeProvidedConfiguration(conf);
// use free port instead of default 50200 port
conf.set(DFSConfigKeys.DFS_PROVIDED_ALIASMAP_INMEMORY_RPC_ADDRESS,
"127.0.0.1:" + NetUtils.getFreeSocketPort());
cluster = new MiniDFSCluster.Builder(conf) cluster = new MiniDFSCluster.Builder(conf)
.numDataNodes(1) .numDataNodes(1)
.build(); .build();