From ee8a152520cd22d578dc163ed9a3da24dfc00f9a Mon Sep 17 00:00:00 2001 From: Andrew Wang Date: Wed, 23 Apr 2014 18:06:21 +0000 Subject: [PATCH] HDFS-5213. TestDataNodeConfig failing on Jenkins runs due to DN web port in use. (wang) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1589474 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../org/apache/hadoop/hdfs/TestDatanodeConfig.java | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 5b40356bdc..fadb3aa5af 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -369,6 +369,9 @@ Release 2.5.0 - UNRELEASED HDFS-6178. Decommission on standby NN couldn't finish. (Ming Ma via jing9) + HDFS-6213. TestDataNodeConfig failing on Jenkins runs due to DN web port + in use. (wang) + Release 2.4.1 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDatanodeConfig.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDatanodeConfig.java index 3507d6f354..cfa14cca41 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDatanodeConfig.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDatanodeConfig.java @@ -51,6 +51,8 @@ public class TestDatanodeConfig { public static void setUp() throws Exception { clearBaseDir(); Configuration conf = new HdfsConfiguration(); + conf.setInt(DFSConfigKeys.DFS_DATANODE_HTTPS_PORT_KEY, 0); + conf.set(DFSConfigKeys.DFS_DATANODE_ADDRESS_KEY, "localhost:0"); cluster = new MiniDFSCluster.Builder(conf).numDataNodes(0).build(); cluster.waitActive(); } @@ -100,8 +102,14 @@ public void testDataDirectories() throws IOException { String dnDir3 = dataDir.getAbsolutePath() + "3"; conf.set(DFSConfigKeys.DFS_DATANODE_DATA_DIR_KEY, dnDir1 + "," + dnDir2 + "," + dnDir3); - cluster.startDataNodes(conf, 1, false, StartupOption.REGULAR, null); - assertTrue("Data-node should startup.", cluster.isDataNodeUp()); + try { + cluster.startDataNodes(conf, 1, false, StartupOption.REGULAR, null); + assertTrue("Data-node should startup.", cluster.isDataNodeUp()); + } finally { + if (cluster != null) { + cluster.shutdownDataNodes(); + } + } } private static String makeURI(String scheme, String host, String path)