Typed Distributed Data requires untyped Cluster #25746 (#26074)

Typed Distributed Data requires untyped Cluster [#25746](https://github.com/akka/akka/issues/25746)
This commit is contained in:
Helena Edelson 2018-12-14 15:53:08 -05:00 committed by GitHub
parent 2c145cd3c3
commit 8a44fca087
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 656 additions and 368 deletions

View file

@ -42,7 +42,8 @@ class ReplicatorORSetDeltaSpec extends MultiNodeSpec(ReplicatorORSetDeltaSpec) w
override def initialParticipants = roles.size
implicit val cluster = Cluster(system)
val cluster = Cluster(system)
implicit val selfUniqueAddress = DistributedData(system).selfUniqueAddress
val replicator = system.actorOf(Replicator.props(
ReplicatorSettings(system).withGossipInterval(1.second)), "replicator")
val timeout = 3.seconds.dilated
@ -88,7 +89,7 @@ class ReplicatorORSetDeltaSpec extends MultiNodeSpec(ReplicatorORSetDeltaSpec) w
}
runOn(first) {
replicator ! Update(KeyA, ORSet.empty[String], WriteLocal)(_ + "a")
replicator ! Update(KeyA, ORSet.empty[String], WriteLocal)(_ :+ "a")
expectMsg(UpdateSuccess(KeyA, None))
}
@ -108,11 +109,11 @@ class ReplicatorORSetDeltaSpec extends MultiNodeSpec(ReplicatorORSetDeltaSpec) w
enterBarrier("split")
runOn(first) {
replicator ! Update(KeyA, ORSet.empty[String], WriteLocal)(_ + "b")
replicator ! Update(KeyA, ORSet.empty[String], WriteLocal)(_ :+ "b")
expectMsg(UpdateSuccess(KeyA, None))
}
runOn(second) {
replicator ! Update(KeyA, ORSet.empty[String], WriteLocal)(_ + "d")
replicator ! Update(KeyA, ORSet.empty[String], WriteLocal)(_ :+ "d")
expectMsg(UpdateSuccess(KeyA, None))
}
runOn(first, second) {
@ -129,7 +130,7 @@ class ReplicatorORSetDeltaSpec extends MultiNodeSpec(ReplicatorORSetDeltaSpec) w
runOn(first) {
// delta for "c" will be sent to third, but it has not received the previous delta for "b"
replicator ! Update(KeyA, ORSet.empty[String], WriteLocal)(_ + "c")
replicator ! Update(KeyA, ORSet.empty[String], WriteLocal)(_ :+ "c")
expectMsg(UpdateSuccess(KeyA, None))
// let the delta be propagated (will not fail if it takes longer)
Thread.sleep(1000)
@ -154,7 +155,7 @@ class ReplicatorORSetDeltaSpec extends MultiNodeSpec(ReplicatorORSetDeltaSpec) w
// and now the delta seqNr should be in sync again
runOn(first) {
replicator ! Update(KeyA, ORSet.empty[String], WriteLocal)(_ + "e")
replicator ! Update(KeyA, ORSet.empty[String], WriteLocal)(_ :+ "e")
expectMsg(UpdateSuccess(KeyA, None))
}
assertValue(KeyA, Set("a", "b", "c", "d", "e"))