Fix timing issue in PartitionedCandidateOnStartupElection*Test 81/56681/4
authorTom Pantelis <tompantelis@gmail.com>
Mon, 8 May 2017 16:49:51 +0000 (12:49 -0400)
committerRobert Varga <nite@hq.sk>
Wed, 10 May 2017 09:19:09 +0000 (09:19 +0000)
commite83057f284dc3c9bf84063a47a18bb41a26aebf3
treed28badea49e0a2b9feb83394734bd35b17810105
parent6ef8a6b4e403d5908e7090a5bd387f81c10c91c6
Fix timing issue in PartitionedCandidateOnStartupElection*Test

If the initial AppendEntries sent by the leader (member 1) to member 3
is delayed enough such that the behavior field in MemberActor is already
set by the test code, the AppendEntries message will be forwarded to the
Candidate behavior and yield incorrect results for the test. To prevent this,
we really shouldn't set and access the behavior field directly but instead
do so via messages to maintain actor encapsulation.

Change-Id: If497583ce648e62e3279e5abff19cb8702943c17
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeaderElectionScenarioTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/DelayedMessagesElectionScenarioTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/PartitionedCandidateOnStartupElectionScenarioTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/PartitionedLeadersElectionScenarioTest.java