Author: stack
Date: Wed Sep 21 17:06:52 2011
New Revision: 1173762

URL: http://svn.apache.org/viewvc?rev=1173762&view=rev
Log:
HBASE-4453 TestReplication failing up on builds.a.o because already running zk 
with new format root servername

Modified:
    hbase/branches/0.90/CHANGES.txt
    
hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtility.java
    
hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/replication/TestReplication.java

Modified: hbase/branches/0.90/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1173762&r1=1173761&r2=1173762&view=diff
==============================================================================
--- hbase/branches/0.90/CHANGES.txt (original)
+++ hbase/branches/0.90/CHANGES.txt Wed Sep 21 17:06:52 2011
@@ -55,6 +55,8 @@ Release 0.90.5 - Unreleased
                RS_ZK_REGION_OPENED (ramkrishna.s.vasudevan)
    HBASE-4445  Not passing --config when checking if distributed mode or not
    HBASE-3421  Very wide rows -- 30M plus -- cause us OOME (Nate Putnam)
+   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)

Modified: 
hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtility.java
URL: 
http://svn.apache.org/viewvc/hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtility.java?rev=1173762&r1=1173761&r2=1173762&view=diff
==============================================================================
--- 
hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtility.java
 (original)
+++ 
hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtility.java
 Wed Sep 21 17:06:52 2011
@@ -76,7 +76,7 @@ public class TestHBaseTestingUtility {
    * @throws Exception
    */
   @Test (timeout=180000)
-  public void multiClusters() throws Exception {
+  public void testMultiClusters() throws Exception {
     // Create three clusters
 
     // Cluster 1.
@@ -88,11 +88,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 {
@@ -168,4 +174,4 @@ public class TestHBaseTestingUtility {
     assertTrue(fs.mkdirs(testdir));
     assertTrue(this.hbt.cleanupTestDir());
   }
-}
\ No newline at end of file
+}

Modified: 
hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/replication/TestReplication.java
URL: 
http://svn.apache.org/viewvc/hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/replication/TestReplication.java?rev=1173762&r1=1173761&r2=1173762&view=diff
==============================================================================
--- 
hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/replication/TestReplication.java
 (original)
+++ 
hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/replication/TestReplication.java
 Wed Sep 21 17:06:52 2011
@@ -103,11 +103,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);
     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);


Reply via email to