From 96321df58284a75fcb0b38f989dc14c0bb3242b0 Mon Sep 17 00:00:00 2001 From: Jean-Daniel Cryans Date: Tue, 18 May 2010 23:23:02 +0000 Subject: [PATCH] HBASE-2539 Cannot start ZK before the rest in tests anymore git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@945956 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 1 + .../java/org/apache/hadoop/hbase/HBaseTestingUtility.java | 7 ++++--- .../test/java/org/apache/hadoop/hbase/TestZooKeeper.java | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) 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); }