zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ph...@apache.org
Subject svn commit: r1138213 - in /zookeeper/trunk: CHANGES.txt src/java/test/org/apache/zookeeper/test/QuorumTest.java
Date Tue, 21 Jun 2011 22:19:04 GMT
Author: phunt
Date: Tue Jun 21 22:19:04 2011
New Revision: 1138213

URL: http://svn.apache.org/viewvc?rev=1138213&view=rev
Log:
ZOOKEEPER-1103. In QuorumTest, use the same "for ( .. try { break } catch { } )" pattern in
testFollowersStartAfterLeaders as in testSessionMove. (Eugene Koontz via 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=1138213&r1=1138212&r2=1138213&view=diff
==============================================================================
--- zookeeper/trunk/CHANGES.txt (original)
+++ zookeeper/trunk/CHANGES.txt Tue Jun 21 22:19:04 2011
@@ -236,6 +236,10 @@ BUGFIXES: 
   ZOOKEEPER-1068. Documentation and default config suggest incorrect
   location for Zookeeper state (Roman Shaposhnik via phunt)
 
+  ZOOKEEPER-1103. In QuorumTest, use the same "for ( .. try { break }
+  catch { } )" pattern in testFollowersStartAfterLeaders as in
+  testSessionMove. (Eugene Koontz via phunt)
+
 IMPROVEMENTS:
   ZOOKEEPER-724. Improve junit test integration - log harness information 
   (phunt via mahadev)

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=1138213&r1=1138212&r2=1138213&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 Tue Jun 21 22:19:04
2011
@@ -316,11 +316,21 @@ public class QuorumTest extends QuorumBa
                 QuorumBase.waitForServerUp(
                         "127.0.0.1:" + qu.getPeer(2).clientPort,
                         CONNECTION_TIMEOUT));
-        Thread.sleep(1000);
 
-        // zk should have reconnected already
-        zk.create("/test", "test".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE,
-                CreateMode.PERSISTENT);
+
+        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.
+            Assert.assertFalse("client could not connect to reestablished quorum: giving
up after 30 seconds.",true);
+        }
+
+
         zk.close();
     }
 



Mime
View raw message