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:26:55 GMT
Repository: zookeeper
Updated Branches:
  refs/heads/branch-3.5 0e4ade36a -> a9437b389


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/a9437b38
Tree: http://git-wip-us.apache.org/repos/asf/zookeeper/tree/a9437b38
Diff: http://git-wip-us.apache.org/repos/asf/zookeeper/diff/a9437b38

Branch: refs/heads/branch-3.5
Commit: a9437b3895d7e8b71d1b542682ad2e4e9f72c9be
Parents: 0e4ade3
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:25:29 2017 -0800

----------------------------------------------------------------------
 .../server/quorum/FLEBackwardElectionRoundTest.java  | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zookeeper/blob/a9437b38/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 bb5aa8f..6c88f0f 100644
--- a/src/java/test/org/apache/zookeeper/server/quorum/FLEBackwardElectionRoundTest.java
+++ b/src/java/test/org/apache/zookeeper/server/quorum/FLEBackwardElectionRoundTest.java
@@ -99,7 +99,8 @@ public class FLEBackwardElectionRoundTest extends ZKTestCase {
             port[i] = clientport;
         }
 
-        ByteBuffer initialMsg = FLETestUtils.createMsg(ServerState.FOLLOWING.ordinal(), 0,
0, 1);
+        ByteBuffer initialMsg0 = getMsg();
+        ByteBuffer initialMsg1 = getMsg();
 
         /*
          * Start server 0
@@ -116,7 +117,7 @@ public class FLEBackwardElectionRoundTest extends ZKTestCase {
         cnxManagers[0] = mockPeer.createCnxnManager();
         cnxManagers[0].listener.start();
 
-        cnxManagers[0].toSend(0l, initialMsg);
+        cnxManagers[0].toSend(0l, initialMsg0);
 
         /*
          * Start mock server 2
@@ -125,7 +126,7 @@ public class FLEBackwardElectionRoundTest extends ZKTestCase {
         cnxManagers[1] = mockPeer.createCnxnManager();
         cnxManagers[1].listener.start();
 
-        cnxManagers[1].toSend(0l, initialMsg);
+        cnxManagers[1].toSend(0l, initialMsg1);
 
         /*
          * Run another instance of leader election.
@@ -137,8 +138,8 @@ public class FLEBackwardElectionRoundTest extends ZKTestCase {
         /*
          * Send the same messages, this time should not make 0 the leader.
          */
-        cnxManagers[0].toSend(0l, initialMsg);
-        cnxManagers[1].toSend(0l, initialMsg);
+        cnxManagers[0].toSend(0l, initialMsg0);
+        cnxManagers[1].toSend(0l, initialMsg1);
 
         thread.join(5000);
 
@@ -147,4 +148,8 @@ public class FLEBackwardElectionRoundTest extends ZKTestCase {
         }
 
     }
+
+    private ByteBuffer getMsg() {
+        return FLETestUtils.createMsg(ServerState.FOLLOWING.ordinal(), 0, 0, 1);
+    }
 }


Mime
View raw message