HBASE-4453 TestReplication failing up on builds.a.o because already running zk with new format root servername

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1173763 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2011-09-21 17:07:38 +00:00
parent bcaecda371
commit 81f93ced4e
3 changed files with 16 additions and 4 deletions

View File

@ -616,6 +616,8 @@ Release 0.90.5 - Unreleased
HBASE-4238 CatalogJanitor can clear a daughter that split before
processing its parent
HBASE-4445 Not passing --config when checking if distributed mode or not
HBASE-4453 TestReplication failing up on builds.a.o because already
running zk with new format root servername
IMPROVEMENT
HBASE-4205 Enhance HTable javadoc (Eric Charles)

View File

@ -77,7 +77,7 @@ public class TestHBaseTestingUtility {
* @throws Exception
*/
@Test (timeout=180000)
public void multiClusters() throws Exception {
public void testMultiClusters() throws Exception {
// Create three clusters
// Cluster 1.
@ -89,11 +89,17 @@ public class TestHBaseTestingUtility {
// 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 {
@ -210,4 +216,4 @@ public class TestHBaseTestingUtility {
assertTrue(fs.mkdirs(testdir));
assertTrue(this.hbt.cleanupTestDir());
}
}
}

View File

@ -104,11 +104,15 @@ public class TestReplication {
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, true);
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);