zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ph...@apache.org
Subject zookeeper git commit: ZOOKEEPER-2806: Flaky test: org.apache.zookeeper.server.quorum.FLEBackwardElectionRoundTest.testBackwardElectionRound
Date Tue, 21 Nov 2017 18:35:00 GMT
Repository: zookeeper
Updated Branches:
  refs/heads/branch-3.4 8ffa2b25d -> ed237bfef


ZOOKEEPER-2806: Flaky test: org.apache.zookeeper.server.quorum.FLEBackwardElectionRoundTest.testBackwardElectionRound

Change-Id: Ia92eb2b2dfbd9b7c464abdc7ae018f426e591538
(cherry picked from commit 851075b5e388525a89fb0579150c2a3ed9e59bcd)


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

Branch: refs/heads/branch-3.4
Commit: ed237bfef5876de27908591cb622c7fbfd71b11b
Parents: 8ffa2b2
Author: Abraham Fine <abefine@cloudera.com>
Authored: Tue Jun 13 11:57:22 2017 -0700
Committer: Patrick Hunt <phunt@apache.org>
Committed: Tue Nov 21 10:32:20 2017 -0800

----------------------------------------------------------------------
 .../quorum/FLEBackwardElectionRoundTest.java    | 21 ++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ed237bfe/src/java/test/org/apache/zookeeper/server/quorum/FLEBackwardElectionRoundTest.java
----------------------------------------------------------------------
diff --git a/src/java/test/org/apache/zookeeper/server/quorum/FLEBackwardElectionRoundTest.java
b/src/java/test/org/apache/zookeeper/server/quorum/FLEBackwardElectionRoundTest.java
index c0ab3ea..2d3ad5c 100644
--- a/src/java/test/org/apache/zookeeper/server/quorum/FLEBackwardElectionRoundTest.java
+++ b/src/java/test/org/apache/zookeeper/server/quorum/FLEBackwardElectionRoundTest.java
@@ -99,6 +99,9 @@ public class FLEBackwardElectionRoundTest extends ZKTestCase {
             port[i] = clientport;
         }
 
+        ByteBuffer initialMsg0 = getMsg();
+        ByteBuffer initialMsg1 = getMsg();
+
         /*
          * Start server 0
          */
@@ -117,8 +120,7 @@ public class FLEBackwardElectionRoundTest extends ZKTestCase {
         QuorumCnxManager.Listener listener = cnxManagers[0].listener;
         listener.start();
 
-        ByteBuffer msg = FLETestUtils.createMsg(ServerState.FOLLOWING.ordinal(), 0, 0, 1);
-        cnxManagers[0].toSend(0l, msg);
+        cnxManagers[0].toSend(0l, initialMsg0);
         
         /*
          * Start mock server 2
@@ -128,7 +130,7 @@ public class FLEBackwardElectionRoundTest extends ZKTestCase {
         listener = cnxManagers[1].listener;
         listener.start();
 
-        cnxManagers[1].toSend(0l, msg);
+        cnxManagers[1].toSend(0l, initialMsg1);
         
         /*
          * Run another instance of leader election.
@@ -140,10 +142,9 @@ public class FLEBackwardElectionRoundTest extends ZKTestCase {
         /*
          * Send the same messages, this time should not make 0 the leader.
          */
-        cnxManagers[0].toSend(0l, msg);
-        cnxManagers[1].toSend(0l, msg);
-        
-        
+        cnxManagers[0].toSend(0l, initialMsg0);
+        cnxManagers[1].toSend(0l, initialMsg1);
+
         thread.join(5000);
         
         if (!thread.isAlive()) {
@@ -151,4 +152,8 @@ public class FLEBackwardElectionRoundTest extends ZKTestCase {
         }
         
     }
-}
\ No newline at end of file
+
+    private ByteBuffer getMsg() {
+        return FLETestUtils.createMsg(ServerState.FOLLOWING.ordinal(), 0, 0, 1);
+    }
+}


Mime
View raw message