Skip to content

Commit cdd2f41

Browse files
committed
🚨test: Retry sending InstallSnapshot if it didn't arrive
1 parent d1597d7 commit cdd2f41

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/test/scala/lerna/akka/entityreplication/raft/RaftActorLeaderSpec.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,12 @@ class RaftActorLeaderSpec extends TestKit(ActorSystem()) with RaftActorSpecBase
252252
state.stateData.lastSnapshotStatus.snapshotLastLogIndex should be(lastLogIndex)
253253
}
254254
// InstallSnapshot is idempotent: InstallSnapshot will succeed again if it has already succeeded
255-
leader ! installSnapshotCommand
256-
region.expectMsgType[ReplicationRegion.DeliverTo].message should be(expectedSuccessfulResponse)
255+
awaitAssert {
256+
leader ! installSnapshotCommand
257+
region.expectMsgType[ReplicationRegion.DeliverTo](max = 500.millis).message should be(
258+
expectedSuccessfulResponse,
259+
)
260+
}
257261
}
258262

259263
"send AppendEntries to the follower when the leader has log entries that follower requires" in {

0 commit comments

Comments
 (0)