Index: src/test/org/apache/hadoop/hbase/TestZooKeeper.java =================================================================== --- src/test/org/apache/hadoop/hbase/TestZooKeeper.java (revision 942626) +++ src/test/org/apache/hadoop/hbase/TestZooKeeper.java (working copy) @@ -21,6 +21,8 @@ import java.io.IOException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.client.HConnection; @@ -39,6 +41,8 @@ * */ public class TestZooKeeper extends HBaseClusterTestCase { + private final Log LOG = LogFactory.getLog(this.getClass()); + private static class EmptyWatcher implements Watcher { public static EmptyWatcher instance = new EmptyWatcher(); private EmptyWatcher() {} @@ -47,6 +51,7 @@ @Override protected void setUp() throws Exception { + this.conf.setBoolean("dfs.support.append", true); setOpenMetaTable(false); super.setUp(); } @@ -83,7 +88,7 @@ * @throws IOException */ public void testParentExists() throws IOException { - String oldValue = conf.get("zookeeper.znode.safemode"); + String oldValue = conf.get("zookeeper.znode.safemode", "safe-mode"); conf.set("zookeeper.znode.safemode", "/a/b/c/d/e"); ZooKeeperWrapper zooKeeper = new ZooKeeperWrapper(conf, EmptyWatcher.instance); assertTrue(zooKeeper.writeOutOfSafeMode()); @@ -116,6 +121,7 @@ } public void testRegionServerSessionExpired() throws Exception{ + LOG.info("Starting " + getName()); this.conf.setBoolean("hbase.regionserver.restart.on.zk.expire", true); new HTable(conf, HConstants.META_TABLE_NAME); HRegionServer rs = cluster.getRegionServer(0); @@ -123,6 +129,7 @@ } public void testMasterSessionExpired() throws Exception { + LOG.info("Starting " + getName()); new HTable(conf, HConstants.META_TABLE_NAME); HMaster master = cluster.getMaster(); sessionExpirationHelper(master.getZooKeeperWrapper()); @@ -140,7 +147,7 @@ sessionTimeout, EmptyWatcher.instance, sessionID, password); zk.close(); - + LOG.info("ZK Closed; sleeping=" + sessionTimeout * 3L); Thread.sleep(sessionTimeout * 3L); new HTable(conf, HConstants.META_TABLE_NAME); @@ -150,7 +157,7 @@ HColumnDescriptor family = new HColumnDescriptor("fam"); desc.addFamily(family); admin.createTable(desc); - + LOG.info("Created " + desc); HTable table = new HTable("test"); Put put = new Put(Bytes.toBytes("testrow")); put.add(Bytes.toBytes("fam"), Bytes.toBytes("col"), Bytes.toBytes("testdata"));