hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1203841 - /hbase/trunk/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKLeaderManager.java
Date Fri, 18 Nov 2011 21:08:38 GMT
Author: garyh
Date: Fri Nov 18 21:08:38 2011
New Revision: 1203841

URL: http://svn.apache.org/viewvc?rev=1203841&view=rev
Log:
Amend HBASE-2742  Fix intermittent TestZKLeaderManager failure

Modified:
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKLeaderManager.java

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKLeaderManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKLeaderManager.java?rev=1203841&r1=1203840&r2=1203841&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKLeaderManager.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKLeaderManager.java Fri
Nov 18 21:08:38 2011
@@ -149,7 +149,7 @@ public class TestZKLeaderManager {
     assertNotNull("Leader should exist", currentLeader);
     LOG.debug("Current leader index is "+currentLeader.getIndex());
 
-    byte[] znodeData = ZKUtil.getData(CANDIDATES[0].getWatcher(), LEADER_ZNODE);
+    byte[] znodeData = ZKUtil.getData(currentLeader.getWatcher(), LEADER_ZNODE);
     assertNotNull("Leader znode should contain leader index", znodeData);
     assertTrue("Leader znode should not be empty", znodeData.length > 0);
     int storedIndex = Bytes.toInt(znodeData);
@@ -167,7 +167,7 @@ public class TestZKLeaderManager {
     assertNotNull("New leader should exist after abdication", currentLeader);
     LOG.debug("New leader index is "+currentLeader.getIndex());
 
-    znodeData = ZKUtil.getData(CANDIDATES[0].getWatcher(), LEADER_ZNODE);
+    znodeData = ZKUtil.getData(currentLeader.getWatcher(), LEADER_ZNODE);
     assertNotNull("Leader znode should contain leader index", znodeData);
     assertTrue("Leader znode should not be empty", znodeData.length > 0);
     storedIndex = Bytes.toInt(znodeData);
@@ -185,7 +185,7 @@ public class TestZKLeaderManager {
     assertNotNull("New leader should exist after stop", currentLeader);
     LOG.debug("New leader index is "+currentLeader.getIndex());
 
-    znodeData = ZKUtil.getData(CANDIDATES[0].getWatcher(), LEADER_ZNODE);
+    znodeData = ZKUtil.getData(currentLeader.getWatcher(), LEADER_ZNODE);
     assertNotNull("Leader znode should contain leader index", znodeData);
     assertTrue("Leader znode should not be empty", znodeData.length > 0);
     storedIndex = Bytes.toInt(znodeData);



Mime
View raw message