Fix intermittent PreLeaderScenarioTest failure 67/62767/4
authorTom Pantelis <tompantelis@gmail.com>
Wed, 6 Sep 2017 10:59:32 +0000 (06:59 -0400)
committerRobert Varga <nite@hq.sk>
Thu, 7 Sep 2017 10:39:50 +0000 (10:39 +0000)
commitc32a09739f0f7a008fe203b7b4ca172755136307
tree7071cec12cf10b2e0a65769ab3556ce990546f0b
parent53f61d00a4589d7c56b3483a0e63debbb55fe5f4
Fix intermittent PreLeaderScenarioTest failure

testUnComittedEntryOnLeaderChange(org.opendaylight.controller.cluster.raft.PreLeaderScenarioTest)  Time elapsed: 5.207 sec  <<< FAILURE!
java.lang.AssertionError: Did not receive message of type class org.opendaylight.controller.cluster.raft.messages.AppendEntries
  at org.opendaylight.controller.cluster.raft.utils.MessageCollectorActor.expectFirstMatching(MessageCollectorActor.java:147)
  at org.opendaylight.controller.cluster.raft.utils.MessageCollectorActor.expectFirstMatching(MessageCollectorActor.java:125)
  at org.opendaylight.controller.cluster.raft.PreLeaderScenarioTest.testUnComittedEntryOnLeaderChange(PreLeaderScenarioTest.java:56)

The MessageCollectorActor does receive the message but occasionally out of order
w.r.t the CLEAR_MESSAGES although the latter is sent prior. The problem is that
AppendEntries is a ControlMessage so can get delivered before CLEAR_MESSAGES thus
CLEAR_MESSAGES needs to also be a ControlMessage.

Another problem with many of the tests is that MessageCollectorActors are created
as TestActors and thus get the CallingThreadDispatcher by default which really isn't
desirable. Some of the tests specifically set the default fork-join dispatcher but
we should just create MessageCollectorActors as normal actors.

Change-Id: I455a500d39aae4c46fb33d59be24c6327a9d321d
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
25 files changed:
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/AbstractRaftActorIntegrationTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/IsolationScenarioTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/LeadershipTransferIntegrationTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/NonVotingFollowerIntegrationTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/PreLeaderScenarioTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorServerConfigurationSupportTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/SnapshotManagerTest.java
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/AbstractRaftActorBehaviorTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/CandidateTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/FollowerTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/IsolatedLeaderTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/LeaderTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/SyncStatusTrackerTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/ForwardMessageToBehaviorActor.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/MessageCollectorActor.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractShardManagerTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataChangeListenerProxyTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ForwardingDataTreeChangeListenerTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/RoleChangeNotifierTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipShardTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/shardmanager/ShardManagerTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/ActorContextTest.java

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.