diff --git a/CHANGES.txt b/CHANGES.txt index 65108d77bc7..aa2616095c6 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -334,6 +334,7 @@ Release 0.21.0 - Unreleased HBASE-2562 bin/hbase doesn't work in-situ in maven (Todd Lipcon via Stack) HBASE-2449 Local HBase does not stop properly + HBASE-2539 Cannot start ZK before the rest in tests anymore IMPROVEMENTS HBASE-1760 Cleanup TODOs in HTable diff --git a/core/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java b/core/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java index 03814eb4fe6..a6aca1d85ba 100644 --- a/core/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java +++ b/core/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java @@ -151,13 +151,14 @@ public class HBaseTestingUtility { * @see #shutdownMiniZKCluster() */ public void startMiniZKCluster() throws Exception { - isRunningCluster(); - this.clusterTestBuildDir = setupClusterTestBuildDir(); - startMiniZKCluster(this.clusterTestBuildDir); + startMiniZKCluster(setupClusterTestBuildDir()); } private void startMiniZKCluster(final File dir) throws Exception { + if (this.zkCluster != null) { + throw new IOException("Cluster already running at " + dir); + } this.zkCluster = new MiniZooKeeperCluster(); int clientPort = this.zkCluster.startup(dir); this.conf.set("hbase.zookeeper.property.clientPort", diff --git a/core/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java b/core/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java index 7ae00f6ef87..5df956c56c2 100644 --- a/core/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java +++ b/core/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java @@ -45,6 +45,8 @@ public class TestZooKeeper { */ @BeforeClass public static void setUpBeforeClass() throws Exception { + // Test we can first start the ZK cluster by itself + TEST_UTIL.startMiniZKCluster(); TEST_UTIL.getConfiguration().setBoolean("dfs.support.append", true); TEST_UTIL.startMiniCluster(1); }