bookkeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mme...@apache.org
Subject bookkeeper git commit: BOOKKEEPER-914: ReadOnlyBookieTest.testBookieShouldTurnWritableFromReadOnly is intermettently failing
Date Thu, 07 Apr 2016 19:55:20 GMT
Repository: bookkeeper
Updated Branches:
  refs/heads/master 3fe7e7dad -> 3efde26e0


BOOKKEEPER-914: ReadOnlyBookieTest.testBookieShouldTurnWritableFromReadOnly is intermettently
failing

BOOKKEEPER-914 fixed testBookieShouldTurnWritableFromReadOnly flapping.
Now test waits for bookie to transition to read-only.

Author: Andrey Yegorov <ayegorov@salesforce.com>

Reviewers: Matteo Merli <mmerli@apache.org>, Sijie Guo <sijie@apache.org>

Closes #32 from dlg99/bugfix/BOOKKEEPER-914


Project: http://git-wip-us.apache.org/repos/asf/bookkeeper/repo
Commit: http://git-wip-us.apache.org/repos/asf/bookkeeper/commit/3efde26e
Tree: http://git-wip-us.apache.org/repos/asf/bookkeeper/tree/3efde26e
Diff: http://git-wip-us.apache.org/repos/asf/bookkeeper/diff/3efde26e

Branch: refs/heads/master
Commit: 3efde26e0510be38237c73a7bfeeb105f25d8dbe
Parents: 3fe7e7d
Author: Andrey Yegorov <ayegorov@salesforce.com>
Authored: Thu Apr 7 12:39:46 2016 -0700
Committer: Matteo Merli <mmerli@apache.org>
Committed: Thu Apr 7 12:39:46 2016 -0700

----------------------------------------------------------------------
 .../java/org/apache/bookkeeper/test/ReadOnlyBookieTest.java  | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/3efde26e/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/ReadOnlyBookieTest.java
----------------------------------------------------------------------
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/ReadOnlyBookieTest.java
b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/ReadOnlyBookieTest.java
index cf2b251..21617a5 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/ReadOnlyBookieTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/ReadOnlyBookieTest.java
@@ -36,6 +36,7 @@ import org.apache.bookkeeper.client.BookKeeper.DigestType;
 import org.apache.bookkeeper.client.LedgerEntry;
 import org.apache.bookkeeper.client.LedgerHandle;
 import org.apache.bookkeeper.conf.ServerConfiguration;
+import org.apache.bookkeeper.util.BookKeeperConstants;
 import org.junit.Test;
 
 /**
@@ -125,6 +126,13 @@ public class ReadOnlyBookieTest extends BookKeeperClusterTestCase {
         } catch (BKException.BKNotEnoughBookiesException e) {
             // Expected
         }
+
+        // wait for zk to get updated (async) as bookie transitions to read-only
+        while (zkc.exists(baseConf.getZkAvailableBookiesPath() + "/" + BookKeeperConstants.READONLY
+ "/"
+                + Bookie.getBookieAddress(bsConfs.get(1)).toString(), false) == null) {
+            Thread.sleep(100);
+        }
+        
         LOG.info("bookie is running {}, readonly {}.", bookie.isRunning(), bookie.isReadOnly());
         assertTrue("Bookie should be running and converted to readonly mode",
                 bookie.isRunning() && bookie.isReadOnly());


Mime
View raw message