Fix race condition on shard region noticing shard shutdown in RememberEntitiesAndStartEntitySpec #31221 (#31224)

This commit is contained in:
Johan Andrén 2022-03-09 15:42:56 +01:00 committed by GitHub
parent 93622f56e7
commit f2bd251e19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -91,8 +91,11 @@ class RememberEntitiesAndStartEntitySpec
// trigger shard start by messaging other actor in it
system.log.info("Starting shard again")
sharding ! EntityEnvelope(11, "give-me-shard")
val secondShardIncarnation = expectMsgType[ActorRef]
// race condition between this message and region getting the termination message, we may need to retry
val secondShardIncarnation = awaitAssert {
sharding ! EntityEnvelope(11, "give-me-shard")
expectMsgType[ActorRef]
}
awaitAssert {
secondShardIncarnation ! GetShardStats