Merge pull request #25344 from akka/wip-25342-ReplicatorDeltaSpec-patriknw

Harden ReplicatorDeltaSpec, #25342
This commit is contained in:
Patrik Nordwall 2018-07-12 12:25:14 +02:00 committed by GitHub
commit d330c61203
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -847,6 +847,7 @@ object Replicator {
override def zero: DeltaReplicatedData = this
override def delta: Option[ReplicatedDelta] = None
override def resetDelta: ReplicatedData = this
override def toString: String = "NoDeltaPlaceholder"
}
}
case object DeltaNack extends ReplicatorMessage with DeadLetterSuppression

View file

@ -331,6 +331,13 @@ class ReplicatorDeltaSpec extends MultiNodeSpec(ReplicatorDeltaSpec) with STMult
// Thereafter delta can be propagated and applied again.
deltaReplicator.tell(Update(KeyHigh, Highest(0), writeAll)(_.incr(100)), p1.ref)
p1.expectMsgType[UpdateSuccess[_]]
// Flush the deltaPropagation buffer, otherwise it will contain
// NoDeltaPlaceholder from previous updates and the incr(4) delta will also
// be folded into NoDeltaPlaceholder and not propagated as delta. A few DeltaPropagationTick
// are needed to send to all and flush buffer.
roles.foreach { _
deltaReplicator ! Replicator.Internal.DeltaPropagationTick
}
deltaReplicator.tell(Update(KeyHigh, Highest(0), WriteLocal)(_.incr(4)), p1.ref)
p1.expectMsgType[UpdateSuccess[_]]
}