Index: src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtility.java =================================================================== --- src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtility.java (revision 1172692) +++ src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtility.java (working copy) @@ -76,7 +76,7 @@ * @throws Exception */ @Test (timeout=180000) - public void multiClusters() throws Exception { + public void testMultiClusters() throws Exception { // Create three clusters // Cluster 1. @@ -88,11 +88,17 @@ // Cluster 2 HBaseTestingUtility htu2 = new HBaseTestingUtility(); htu2.getConfiguration().set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/2"); + htu2.getConfiguration().set("hbase.zookeeper.property.clientPort", + htu1.getConfiguration().get("hbase.zookeeper.property.clientPort", "-1")); htu2.setZkCluster(htu1.getZkCluster()); - // Cluster 3. + // Cluster 3; seed it with the conf from htu1 so we pickup the 'right' + // zk cluster config; it is set back into the config. as part of the + // start of minizkcluster. HBaseTestingUtility htu3 = new HBaseTestingUtility(); htu3.getConfiguration().set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/3"); + htu3.getConfiguration().set("hbase.zookeeper.property.clientPort", + htu1.getConfiguration().get("hbase.zookeeper.property.clientPort", "-1")); htu3.setZkCluster(htu1.getZkCluster()); try { @@ -168,4 +174,4 @@ assertTrue(fs.mkdirs(testdir)); assertTrue(this.hbt.cleanupTestDir()); } -} \ No newline at end of file +} Index: src/test/java/org/apache/hadoop/hbase/replication/TestReplication.java =================================================================== --- src/test/java/org/apache/hadoop/hbase/replication/TestReplication.java (revision 1172692) +++ src/test/java/org/apache/hadoop/hbase/replication/TestReplication.java (working copy) @@ -103,11 +103,15 @@ utility1 = new HBaseTestingUtility(conf1); utility1.startMiniZKCluster(); MiniZooKeeperCluster miniZK = utility1.getZkCluster(); + // Have to reget conf1 in case zk cluster location different + // than default + conf1 = utility1.getConfiguration(); zkw1 = new ZooKeeperWatcher(conf1, "cluster1", null); admin = new ReplicationAdmin(conf1); LOG.info("Setup first Zk"); - conf2 = HBaseConfiguration.create(); + // Base conf2 on conf1 so it gets the right zk cluster. + conf2 = HBaseConfiguration.create(conf1); conf2.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/2"); conf2.setInt("hbase.client.retries.number", 6); conf2.setBoolean(HConstants.REPLICATION_ENABLE_KEY, true);