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 2017/11/21 18:25:00 UTC
zookeeper git commit: ZOOKEEPER-2806: Flaky test:
org.apache.zookeeper.server.quorum.FLEBackwardElectionRoundTest.testBackwardElectionRound
Repository: zookeeper
Updated Branches:
refs/heads/master cbe524cdc -> 851075b5e
ZOOKEEPER-2806: Flaky test: org.apache.zookeeper.server.quorum.FLEBackwardElectionRoundTest.testBackwardElectionRound
Change-Id: Ia92eb2b2dfbd9b7c464abdc7ae018f426e591538
Project: http://git-wip-us.apache.org/repos/asf/zookeeper/repo
Commit: http://git-wip-us.apache.org/repos/asf/zookeeper/commit/851075b5
Tree: http://git-wip-us.apache.org/repos/asf/zookeeper/tree/851075b5
Diff: http://git-wip-us.apache.org/repos/asf/zookeeper/diff/851075b5
Branch: refs/heads/master
Commit: 851075b5e388525a89fb0579150c2a3ed9e59bcd
Parents: cbe524c
Author: Abraham Fine <ab...@cloudera.com>
Authored: Tue Jun 13 11:57:22 2017 -0700
Committer: Patrick Hunt <ph...@apache.org>
Committed: Tue Nov 21 10:20:33 2017 -0800
----------------------------------------------------------------------
.../server/quorum/FLEBackwardElectionRoundTest.java | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/851075b5/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 ddb7f91..9b7cc56 100644
--- a/src/java/test/org/apache/zookeeper/server/quorum/FLEBackwardElectionRoundTest.java
+++ b/src/java/test/org/apache/zookeeper/server/quorum/FLEBackwardElectionRoundTest.java
@@ -100,7 +100,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
@@ -117,7 +118,7 @@ public class FLEBackwardElectionRoundTest extends ZKTestCase {
cnxManagers[0] = new QuorumCnxManager(mockPeer);
cnxManagers[0].listener.start();
- cnxManagers[0].toSend(0l, initialMsg);
+ cnxManagers[0].toSend(0l, initialMsg0);
/*
* Start mock server 2
@@ -126,7 +127,7 @@ public class FLEBackwardElectionRoundTest extends ZKTestCase {
cnxManagers[1] = new QuorumCnxManager(mockPeer);
cnxManagers[1].listener.start();
- cnxManagers[1].toSend(0l, initialMsg);
+ cnxManagers[1].toSend(0l, initialMsg1);
/*
* Run another instance of leader election.
@@ -138,8 +139,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);
@@ -148,4 +149,8 @@ public class FLEBackwardElectionRoundTest extends ZKTestCase {
}
}
+
+ private ByteBuffer getMsg() {
+ return FLETestUtils.createMsg(ServerState.FOLLOWING.ordinal(), 0, 0, 1);
+ }
}