HBASE-3252 TestZooKeeperNodeTracker sometimes fails due to a race condition in test notification

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1037015 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andrew Kyle Purtell 2010-11-19 20:35:38 +00:00
parent c7708c5390
commit 3f82b6fcaf
2 changed files with 7 additions and 5 deletions

View File

@ -687,6 +687,8 @@ Release 0.90.0 - Unreleased
HBASE-3239 Handle null regions to flush in HLog.cleanOldLogs (Kannan HBASE-3239 Handle null regions to flush in HLog.cleanOldLogs (Kannan
Muthukkaruppan via JD) Muthukkaruppan via JD)
HBASE-3237 Split request accepted -- BUT CURRENTLY A NOOP HBASE-3237 Split request accepted -- BUT CURRENTLY A NOOP
HBASE-3252 TestZooKeeperNodeTracker sometimes fails due to a race condition
in test notification (Gary Helmling via Andrew Purtell)
IMPROVEMENTS IMPROVEMENTS

View File

@ -118,6 +118,11 @@ public class TestZooKeeperNodeTracker {
// Verify the thread doesn't have a node // Verify the thread doesn't have a node
assertFalse(thread.hasData); assertFalse(thread.hasData);
// Now, start a new ZKNT with the node already available
TestTracker secondTracker = new TestTracker(zk, node, null);
secondTracker.start();
zk.registerListener(secondTracker);
// Put up an additional zk listener so we know when zk event is done // Put up an additional zk listener so we know when zk event is done
TestingZKListener zkListener = new TestingZKListener(zk, node); TestingZKListener zkListener = new TestingZKListener(zk, node);
zk.registerListener(zkListener); zk.registerListener(zkListener);
@ -144,11 +149,6 @@ public class TestZooKeeperNodeTracker {
assertTrue(Bytes.equals(thread.tracker.getData(), dataOne)); assertTrue(Bytes.equals(thread.tracker.getData(), dataOne));
LOG.info("Successfully got data one"); LOG.info("Successfully got data one");
// Now, start a new ZKNT with the node already available
TestTracker secondTracker = new TestTracker(zk, node, null);
secondTracker.start();
zk.registerListener(secondTracker);
// Make sure it's available and with the expected data // Make sure it's available and with the expected data
assertNotNull(secondTracker.getData()); assertNotNull(secondTracker.getData());
assertNotNull(secondTracker.blockUntilAvailable()); assertNotNull(secondTracker.blockUntilAvailable());