Fix spurious failures in RaftActorTest due to RecoveryComplete
testSaveSnapshotSuccessCallsDataPersistence fails sporadically due
to RecoveryComplete interfering with the test. In
handleCaptureSnapshotReply it sets replicatedToAllIndex in the
behavior. On RecoveryCompleted, it initializes the behavior which
creates a new Follower with replicatedToAllIndex initialized to -1.
Recovery is done asyn so if RecoveryCompleted occurs after
CaptureSnapshotReply, the test fails because replicatedToAllIndex
isn't the expected value.
We need to call waitForInitializeBehaviorComplete after creating the
MockRaftActor so recovery and behavior initialization is complete before
starting the tests.
Change-Id: I3176afbf7ac937550c33bdb57d14d6968dbc2514
Signed-off-by: tpantelis <tpanteli@brocade.com>