HDFS-13587. TestQuorumJournalManager fails on Windows. Contributed by Anbang Hu.

(cherry picked from commit c13dea87d9)
This commit is contained in:
Inigo Goiri 2018-05-23 11:36:03 -07:00
parent 76f38f3f8b
commit a138496379
2 changed files with 7 additions and 1 deletions

View File

@ -37,6 +37,7 @@ import org.apache.hadoop.hdfs.DFSConfigKeys;
import org.apache.hadoop.hdfs.MiniDFSCluster; import org.apache.hadoop.hdfs.MiniDFSCluster;
import org.apache.hadoop.hdfs.qjournal.client.QuorumJournalManager; import org.apache.hadoop.hdfs.qjournal.client.QuorumJournalManager;
import org.apache.hadoop.hdfs.qjournal.server.JournalNode; import org.apache.hadoop.hdfs.qjournal.server.JournalNode;
import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem;
import org.apache.hadoop.net.NetUtils; import org.apache.hadoop.net.NetUtils;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
@ -50,6 +51,10 @@ public class MiniJournalCluster {
private int numJournalNodes = 3; private int numJournalNodes = 3;
private boolean format = true; private boolean format = true;
private final Configuration conf; private final Configuration conf;
static {
DefaultMetricsSystem.setMiniClusterMode(true);
}
public Builder(Configuration conf) { public Builder(Configuration conf) {
this.conf = conf; this.conf = conf;

View File

@ -93,7 +93,8 @@ public class TestQuorumJournalManager {
conf.setInt(CommonConfigurationKeysPublic.IPC_CLIENT_CONNECT_MAX_RETRIES_KEY, 0); conf.setInt(CommonConfigurationKeysPublic.IPC_CLIENT_CONNECT_MAX_RETRIES_KEY, 0);
cluster = new MiniJournalCluster.Builder(conf) cluster = new MiniJournalCluster.Builder(conf)
.build(); .baseDir(GenericTestUtils.getRandomizedTestDir().getAbsolutePath())
.build();
cluster.waitActive(); cluster.waitActive();
qjm = createSpyingQJM(); qjm = createSpyingQJM();