zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ph...@apache.org
Subject svn commit: r1421091 - in /zookeeper/trunk: CHANGES.txt src/java/test/org/apache/zookeeper/test/QuorumTest.java
Date Thu, 13 Dec 2012 07:14:31 GMT
Author: phunt
Date: Thu Dec 13 07:14:30 2012
New Revision: 1421091

URL: http://svn.apache.org/viewvc?rev=1421091&view=rev
Log:
ZOOKEEPER-1478. Small bug in QuorumTest.testFollowersStartAfterLeader( ) (Alexander Shraer
via fpj, breed, phunt)

Modified:
    zookeeper/trunk/CHANGES.txt
    zookeeper/trunk/src/java/test/org/apache/zookeeper/test/QuorumTest.java

Modified: zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/trunk/CHANGES.txt?rev=1421091&r1=1421090&r2=1421091&view=diff
==============================================================================
--- zookeeper/trunk/CHANGES.txt (original)
+++ zookeeper/trunk/CHANGES.txt Thu Dec 13 07:14:30 2012
@@ -284,6 +284,9 @@ BUGFIXES:
   ZOOKEEPER-1553. Findbugs configuration is missing some dependencies
   (Sean Busbey via phunt)
 
+  ZOOKEEPER-1478. Small bug in QuorumTest.testFollowersStartAfterLeader( )
+  (Alexander Shraer via fpj, breed, phunt)
+
 IMPROVEMENTS:
 
   ZOOKEEPER-1170. Fix compiler (eclipse) warnings: unused imports,

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/test/QuorumTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/QuorumTest.java?rev=1421091&r1=1421090&r2=1421091&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/test/QuorumTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/test/QuorumTest.java Thu Dec 13 07:14:30
2012
@@ -22,6 +22,7 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
 
 import org.apache.zookeeper.AsyncCallback;
 import org.apache.zookeeper.CreateMode;
@@ -311,22 +312,15 @@ public class QuorumTest extends ZKTestCa
         // break the quorum
         qu.shutdown(index);
 
+        // Wait until we disconnect to proceed
+        watcher.waitForDisconnected(CONNECTION_TIMEOUT);
+        
         // try to reestablish the quorum
         qu.start(index);
-        Assert.assertTrue("quorum reestablishment failed",
-                QuorumBase.waitForServerUp(
-                        "127.0.0.1:" + qu.getPeer(2).clientPort,
-                        CONNECTION_TIMEOUT));
 
-        for (int i = 0; i < 30; i++) {
-            try {
-                zk.create("/test", "test".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE,
-                    CreateMode.PERSISTENT);
-                break;
-            } catch(KeeperException.ConnectionLossException e) {
-                Thread.sleep(1000);
-            }
-            // test fails if we still can't connect to the quorum after 30 seconds.
+        try{
+            watcher.waitForConnected(30000);      
+        } catch(TimeoutException e) {
             Assert.fail("client could not connect to reestablished quorum: giving up after
30+ seconds.");
         }
 



Mime
View raw message