You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by ph...@apache.org on 2011/06/22 21:35:55 UTC

svn commit: r1138595 - /zookeeper/trunk/src/java/test/org/apache/zookeeper/test/QuorumTest.java

Author: phunt
Date: Wed Jun 22 19:35:55 2011
New Revision: 1138595

URL: http://svn.apache.org/viewvc?rev=1138595&view=rev
Log:
Fixed a problem introduced by the first patch for ZOOKEEPER-1103 (phunt)

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

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=1138595&r1=1138594&r2=1138595&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 Wed Jun 22 19:35:55 2011
@@ -317,20 +317,22 @@ public class QuorumTest extends QuorumBa
                         "127.0.0.1:" + qu.getPeer(2).clientPort,
                         CONNECTION_TIMEOUT));
 
-
+        boolean success = false;
         for (int i = 0; i < 30; i++) {
             try {
                 zk.create("/test", "test".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE,
                     CreateMode.PERSISTENT);
+                success = true;
                 break;
             } catch(KeeperException.ConnectionLossException e) {
                 Thread.sleep(1000);
             }
+        }
+        if (!success) {
             // 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);
+            Assert.fail("client could not connect to reestablished quorum: giving up after 30+ seconds.");
         }
 
-
         zk.close();
     }