HBASE-17764 Solve TestMultiSlaveReplication flakiness (Stephen Yuan Jiang)
This commit is contained in:
parent
20cb390529
commit
7dfb3b3194
|
@ -54,7 +54,9 @@ import org.apache.hadoop.hbase.testclassification.LargeTests;
|
|||
import org.apache.hadoop.hbase.util.Bytes;
|
||||
import org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster;
|
||||
import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
|
||||
import org.junit.After;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
@ -107,10 +109,6 @@ public class TestMultiSlaveReplication {
|
|||
conf1.setLong(ReplicationZKLockCleanerChore.TTL_CONFIG_KEY, 0L);
|
||||
|
||||
utility1 = new HBaseTestingUtility(conf1);
|
||||
utility1.startMiniZKCluster();
|
||||
MiniZooKeeperCluster miniZK = utility1.getZkCluster();
|
||||
utility1.setZkCluster(miniZK);
|
||||
new ZooKeeperWatcher(conf1, "cluster1", null, true);
|
||||
|
||||
conf2 = new Configuration(conf1);
|
||||
conf2.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/2");
|
||||
|
@ -119,12 +117,8 @@ public class TestMultiSlaveReplication {
|
|||
conf3.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/3");
|
||||
|
||||
utility2 = new HBaseTestingUtility(conf2);
|
||||
utility2.setZkCluster(miniZK);
|
||||
new ZooKeeperWatcher(conf2, "cluster2", null, true);
|
||||
|
||||
utility3 = new HBaseTestingUtility(conf3);
|
||||
utility3.setZkCluster(miniZK);
|
||||
new ZooKeeperWatcher(conf3, "cluster3", null, true);
|
||||
|
||||
table = new HTableDescriptor(tableName);
|
||||
HColumnDescriptor fam = new HColumnDescriptor(famName);
|
||||
|
@ -134,9 +128,28 @@ public class TestMultiSlaveReplication {
|
|||
table.addFamily(fam);
|
||||
}
|
||||
|
||||
@Before
|
||||
public void startup() throws Exception {
|
||||
utility1.startMiniZKCluster();
|
||||
MiniZooKeeperCluster miniZK = utility1.getZkCluster();
|
||||
utility1.setZkCluster(miniZK);
|
||||
new ZooKeeperWatcher(conf1, "cluster1", null, true);
|
||||
|
||||
utility2.setZkCluster(miniZK);
|
||||
new ZooKeeperWatcher(conf2, "cluster2", null, true);
|
||||
|
||||
utility3.setZkCluster(miniZK);
|
||||
new ZooKeeperWatcher(conf3, "cluster3", null, true);
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
utility1.shutdownMiniZKCluster();
|
||||
}
|
||||
|
||||
@Test(timeout=300000)
|
||||
public void testMultiSlaveReplication() throws Exception {
|
||||
LOG.info("testCyclicReplication");
|
||||
LOG.info("Start the testMultiSlaveReplication Test");
|
||||
MiniHBaseCluster master = utility1.startMiniCluster();
|
||||
utility2.startMiniCluster();
|
||||
utility3.startMiniCluster();
|
||||
|
|
Loading…
Reference in New Issue