Hardening of ReplicatedEventSourcingSpec, #30842 (#30937)

* from logs it looks like the replicated event from the first
  incarnation of the actor isn't stored before the second
  incarnation is replayed
* stop and wait for termination before starting second incarnation
This commit is contained in:
Patrik Nordwall 2021-11-24 13:53:29 +01:00 committed by GitHub
parent 5e523053e3
commit 3a2c1a688d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -202,6 +202,8 @@ class ReplicatedEventSourcingSpec
r1 ! StoreMe("Event", replyProbe.ref)
eventProbeR1.expectMessage(EventAndContext("Event", ReplicaId("R1"), recoveryRunning = false, false))
replyProbe.expectMessage(Done)
r1 ! Stop
replyProbe.expectTerminated(r1)
val recoveryProbe = createTestProbe[EventAndContext]()
spawn(testBehavior(entityId, "R1", recoveryProbe.ref))
@ -371,6 +373,11 @@ class ReplicatedEventSourcingSpec
eventProbeR1.expectMessage(
EventAndContext("from r2", ReplicaId("R2"), recoveryRunning = false, concurrent = true))
r1 ! Stop
r2 ! Stop
probe.expectTerminated(r1)
probe.expectTerminated(r2)
// take 2
val eventProbeR1Take2 = createTestProbe[EventAndContext]()
spawn(testBehavior(entityId, "R1", eventProbeR1Take2.ref))