Fix timing issue in testChangeToVotingWithNoLeader
RaftActorServerConfigurationSupportTest#testChangeToVotingWithNoLeader
failed on jenkins:
RaftActorServerConfigurationSupportTest.testChangeToVotingWithNoLeader:1213 getStatus expected:<OK> but was:<NO_LEADER>
In the following test code:
MessageCollectorActor.clearMessages(node1Collector);
long term = ...
node1RaftActorRef.tell(new AppendEntries(...). ActorRef.noSender());
// Wait for the ElectionTimeout to clear the leaderId...
MessageCollectorActor.expectFirstMatching(node1Collector, ElectionTimeout.class)
It expects an ElectionTimeout message to occur after the AppendEntries tell
but it's possible for an ElectionTimeout message to occur in between
clearMessages and tell calls which leads to the subsequent NO_LEADER b/c the
leaderId wasn't cleared yet via a subsequent ElectionTimeout message.
The test expects the leaderId to be cleared after the AppendEntries tell so
I changed it to explicitly check for that. The fact that it's actually cleared
as a side effect of an ElectionTimeout message is an implementation detail
anyway.
Change-Id: I66eaad090d0e75fc3731e59f0a345cb04b4f2c4c
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>