Add leader unit test for non-voting consensus 27/29027/4
authorTom Pantelis <tpanteli@brocade.com>
Fri, 30 Oct 2015 01:20:24 +0000 (21:20 -0400)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 2 Nov 2015 13:32:54 +0000 (13:32 +0000)
commite46efc1aec2ec777a876d8fae0b7598e76291302
treefe4d9750edeeaed1f0155a7ca87b5fdb0e68ddeb
parent9b013985b871adb08173dd8e90d5cf2af82fa5a1
Add leader unit test for non-voting consensus

Added a test case to LeaderTest to verify a non-voting follower
does not influence replication consensus.

Also I saw intermitent test failures (in jenkins as well during first
verify build) due to a message going to dead letters shortly after
actor creation (also reported in Bug 4223). Specifically it was occurring
when the leader sent the initial AppendEntries heartbeat to a follower. This
seems like a timing issue/bug in akka when using an ActorSelection. I
added code in the TestActorFactory to use an actorSelection and call
resolveOne in a retry loop. This seems to alleviate the issue as I ran
LeaderTest over 1000 times successfully.

Change-Id: I65cb87f419c280befe2d82300a981bd8e6f88742
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/TestActorFactory.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/LeaderTest.java