This commit is contained in:
parent
3683830af7
commit
ced82528cf
1 changed files with 6 additions and 6 deletions
|
|
@ -252,15 +252,15 @@ class ReplicatedEventSourcingSpec
|
||||||
val eventProbeR2 = createTestProbe[EventAndContext]()
|
val eventProbeR2 = createTestProbe[EventAndContext]()
|
||||||
val r1 = spawn(testBehavior(entityId, "R1", eventProbeR1.ref))
|
val r1 = spawn(testBehavior(entityId, "R1", eventProbeR1.ref))
|
||||||
val r2 = spawn(testBehavior(entityId, "R2", eventProbeR2.ref))
|
val r2 = spawn(testBehavior(entityId, "R2", eventProbeR2.ref))
|
||||||
val latch1 = new CountDownLatch(1)
|
val latch = new CountDownLatch(3)
|
||||||
val latch2 = new CountDownLatch(1)
|
r1 ! StoreMe("from r1", probe.ref, latch) // R1 0 R2 0 -> R1 1 R2 0
|
||||||
r1 ! StoreMe("from r1", probe.ref, latch1) // R1 0 R2 0 -> R1 1 R2 0
|
r2 ! StoreMe("from r2", probe.ref, latch) // R2 0 R1 0 -> R2 1 R1 0
|
||||||
r2 ! StoreMe("from r2", probe.ref, latch2) // R2 0 R1 0 -> R2 1 R1 0
|
|
||||||
|
|
||||||
// the commands have arrived in both actors, waiting for the latch,
|
// the commands have arrived in both actors, waiting for the latch,
|
||||||
// so that the persist of the events will be concurrent
|
// so that the persist of the events will be concurrent
|
||||||
latch1.countDown()
|
latch.countDown()
|
||||||
latch2.countDown()
|
latch.await(10, TimeUnit.SECONDS)
|
||||||
|
latch.countDown()
|
||||||
|
|
||||||
// each gets its local event
|
// each gets its local event
|
||||||
eventProbeR1.expectMessage(
|
eventProbeR1.expectMessage(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue