Fix port configuration for basic cluster example spec (#29836)

This commit is contained in:
Christopher Batey 2020-11-30 08:32:20 +00:00 committed by GitHub
parent ae22f114b2
commit 385e075fdc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,6 +4,7 @@
package docs.akka.cluster.typed
import akka.actor.testkit.typed.scaladsl.ActorTestKit
import akka.actor.testkit.typed.scaladsl.LogCapturing
import akka.testkit.SocketUtil
import com.github.ghik.silencer.silent
@ -119,6 +120,8 @@ class BasicClusterConfigSpec extends AnyWordSpec with ScalaFutures with Eventual
val sys2Port = SocketUtil.temporaryLocalPort()
def config(port: Int) = ConfigFactory.parseString(s"""
akka.remote.classic.netty.tcp.port = $port
akka.remote.artery.canonical.port = $port
akka.cluster.jmx.multi-mbeans-in-same-jvm = on
akka.cluster.seed-nodes = [ "akka://ClusterSystem@127.0.0.1:$sys1Port", "akka://ClusterSystem@127.0.0.1:$sys2Port" ]
""")
@ -128,10 +131,8 @@ class BasicClusterConfigSpec extends AnyWordSpec with ScalaFutures with Eventual
Cluster(system1)
Cluster(system2)
} finally {
system1.terminate()
system1.whenTerminated.futureValue
system2.terminate()
system2.whenTerminated.futureValue
ActorTestKit.shutdown(system1)
ActorTestKit.shutdown(system2)
}
}
@ -200,10 +201,8 @@ class BasicClusterManualSpec extends AnyWordSpec with ScalaFutures with Eventual
cluster2.isTerminated shouldEqual true
}
} finally {
system.terminate()
system.whenTerminated.futureValue
system2.terminate()
system2.whenTerminated.futureValue
ActorTestKit.shutdown(system)
ActorTestKit.shutdown(system2)
}
}
@ -287,12 +286,9 @@ class BasicClusterManualSpec extends AnyWordSpec with ScalaFutures with Eventual
system3.whenTerminated.futureValue
} finally {
system1.terminate()
system1.whenTerminated.futureValue
system2.terminate()
system2.whenTerminated.futureValue
system3.terminate()
system3.whenTerminated.futureValue
ActorTestKit.shutdown(system1)
ActorTestKit.shutdown(system2)
ActorTestKit.shutdown(system3)
}
}
}