Fix intermittent testOwnerChangesOnPeerAvailabilityChanges failure 28/62428/3
authorTom Pantelis <tompantelis@gmail.com>
Tue, 29 Aug 2017 19:42:12 +0000 (15:42 -0400)
committerRobert Varga <nite@hq.sk>
Wed, 30 Aug 2017 09:43:57 +0000 (09:43 +0000)
commit1b0f84c4957e464bad6f7cb7350a8171c3d1621b
treed1495bdf4c68b1498cfc23494e481f352f4c56ee
parent0792888092341cbb7db5f851a5e3bcbca9609e73
Fix intermittent testOwnerChangesOnPeerAvailabilityChanges failure

EntityOwnershipShardTest.testOwnerChangesOnPeerAvailabilityChanges:647->AbstractEntityOwnershipTest.verifyRaftState:280->lambda$testOwnerChangesOnPeerAvailabilityChanges$2:648 getRaftState expected:<[]Leader> but was:<[Pre]Leader>

It seems this was indirectly introduced by the addition of the
PurgeTransactionPayload - changes the timing of things a bit. I added
code to ensure peer2's lastAppliedIndex is up-to-date with the leader's
prior to stopping the leader to make it deterministic (ie peer2 should
be able to go straight to Leader).

Change-Id: I9abb950c7dc67b2d481d07b9b421ae46421b6510
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeader.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/PreLeader.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipShardTest.java