Return-Path: X-Original-To: apmail-zookeeper-commits-archive@www.apache.org Delivered-To: apmail-zookeeper-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6EA96D44C for ; Thu, 13 Dec 2012 07:15:02 +0000 (UTC) Received: (qmail 97933 invoked by uid 500); 13 Dec 2012 07:15:02 -0000 Delivered-To: apmail-zookeeper-commits-archive@zookeeper.apache.org Received: (qmail 97833 invoked by uid 500); 13 Dec 2012 07:15:01 -0000 Mailing-List: contact commits-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ Delivered-To: mailing list commits@zookeeper.apache.org Received: (qmail 97794 invoked by uid 99); 13 Dec 2012 07:15:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Dec 2012 07:15:00 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Dec 2012 07:14:51 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id D1A7C2388906; Thu, 13 Dec 2012 07:14:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@zookeeper.apache.org From: phunt@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121213071431.D1A7C2388906@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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."); }