Fix RaftActorTest.testRaftRoleChangeNotifier failure
I saw this test fail once:
java.lang.AssertionError: expected:<3> but was:<2>
at org.junit.Assert.fail(Assert.java:88)
at org.junit.Assert.failNotEquals(Assert.java:743)
at org.junit.Assert.assertEquals(Assert.java:118)
at org.junit.Assert.assertEquals(Assert.java:555)
at org.junit.Assert.assertEquals(Assert.java:542)
at
org.opendaylight.controller.cluster.raft.RaftActorTest$13.<init>(RaftActorTest.java:894)
at
org.opendaylight.controller.cluster.raft.RaftActorTest.testRaftRoleChangeNotifier(RaftActorTest.java:881)
The test has an arbitrary 2 sec wait before retrieving the collected
RoleChanged messages. With the election timeout and arbitrary GC and threading
delays, 2 sec may not be enough.
Arbitrary sleeps in tests are usually trouble - I made it deterministic
by waiting 5 sec for the expected messages.
Change-Id: I51c24a5844321bbd000a0460777d08b51a5f82c8
Signed-off-by: tpantelis <tpanteli@brocade.com>