You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2011/04/02 20:09:19 UTC
svn commit: r1088068 -
/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
Author: stack
Date: Sat Apr 2 18:09:19 2011
New Revision: 1088068
URL: http://svn.apache.org/viewvc?rev=1088068&view=rev
Log:
Added extra logging and a retry before throwing assertion to TestSplitTransactionOnCluster, a commonly failing test
Modified:
hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java?rev=1088068&r1=1088067&r2=1088068&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java Sat Apr 2 18:09:19 2011
@@ -97,8 +97,7 @@ public class TestSplitTransactionOnClust
*/
@Test (timeout = 600000) public void testPendingCloseAndSplit()
throws IOException, InterruptedException, NodeExistsException, KeeperException {
- final byte [] tableName =
- Bytes.toBytes("pendingClose");
+ final byte [] tableName = Bytes.toBytes("pendingCloseAndSplit");
// Create table then get the single region for our new table.
HTable t = TESTING_UTIL.createTable(tableName, HConstants.CATALOG_FAMILY);
@@ -126,6 +125,7 @@ public class TestSplitTransactionOnClust
MiniHBaseCluster.MiniHBaseClusterRegionServer.TEST_SKIP_CLOSE = true;
this.cluster.getMaster().unassign(hri.getRegionName(), false);
// Now try splitting and it should work.
+ LOG.info("Running split on server " + server.toString());
split(hri, server, regionCount);
// Get daughters
List<HRegion> daughters = this.cluster.getRegions(tableName);
@@ -133,8 +133,14 @@ public class TestSplitTransactionOnClust
// Assert the ephemeral node is gone in zk.
String path = ZKAssign.getNodeName(t.getConnection().getZooKeeperWatcher(),
hri.getEncodedName());
- Stat stats = t.getConnection().getZooKeeperWatcher().getZooKeeper().exists(path, false);
- assertTrue(stats == null);
+ Stat stat = null;
+ for (int i = 0; i < 10; i++) {
+ stat = t.getConnection().getZooKeeperWatcher().getZooKeeper().exists(path, false);
+ LOG.info("Stat for znode path=" + path + ": " + stat);
+ if (stat == null) break;
+ org.apache.hadoop.hbase.util.Threads.sleep(100);
+ }
+ assertTrue(stat == null);
} finally {
// Set this flag back.
MiniHBaseCluster.MiniHBaseClusterRegionServer.TEST_SKIP_CLOSE = false;