From f7b4a08308b4d678e31aa2ca9554ebb64941c57f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Andr=C3=A9n?= Date: Tue, 9 Jan 2018 17:03:50 +0100 Subject: [PATCH] Review updates and making the Receptionist API work from Java plus workaround for guardian start race --- .../cluster/typed/ReceptionistExampleSpec.scala | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/akka-cluster-typed/src/test/scala/docs/akka/cluster/typed/ReceptionistExampleSpec.scala b/akka-cluster-typed/src/test/scala/docs/akka/cluster/typed/ReceptionistExampleSpec.scala index 7e22fee02b..ba9e1e680d 100644 --- a/akka-cluster-typed/src/test/scala/docs/akka/cluster/typed/ReceptionistExampleSpec.scala +++ b/akka-cluster-typed/src/test/scala/docs/akka/cluster/typed/ReceptionistExampleSpec.scala @@ -173,11 +173,12 @@ akka { remote { netty.tcp { hostname = "127.0.0.1" - port = 0 + port = 2551 } } } #config +akka.remote.netty.tcp.port = 0 """) } @@ -196,11 +197,16 @@ class ReceptionistExampleSpec extends WordSpec with ScalaFutures { "A remote basic example" must { "show register" in { - val system1 = ActorSystem(guardianJustPingService, "PingPongExample", clusterConfig) - val system2 = ActorSystem(guardianJustPinger, "PingPongExample", clusterConfig) + // FIXME cannot use guardian as it touches receptionist #24279 + import scaladsl.adapter._ + val system1 = akka.actor.ActorSystem("PingPongExample", clusterConfig) + val system2 = akka.actor.ActorSystem("PingPongExample", clusterConfig) - val cluster1 = Cluster(system1) - val cluster2 = Cluster(system2) + system1.spawnAnonymous(guardianJustPingService) + system2.spawnAnonymous(guardianJustPinger) + + val cluster1 = Cluster(system1.toTyped) + val cluster2 = Cluster(system2.toTyped) cluster1.manager ! Join(cluster1.selfMember.address) cluster1.manager ! Join(cluster2.selfMember.address)