reserve UPD or TPC ports according to artery config

This commit is contained in:
Renato Cavalcanti 2020-03-02 21:13:58 +01:00
parent 335d205782
commit 343632fc01
No known key found for this signature in database
GPG key ID: C7F92AA2BCB77E03

View file

@ -17,7 +17,13 @@ class ArteryFailedToBindSpec extends AnyWordSpec with Matchers {
"an ActorSystem" must {
"not start if port is taken" in {
val port = SocketUtil.temporaryLocalPort(true)
// this test is tweaked in Jenkins CI by passing -Dakka.remote.artery.transport
// therefore we must decide whether to use UDP or not based on the runtime config
val arterySettings = ArterySettings(ConfigFactory.load().getConfig("akka.remote.artery"))
val useUdp = arterySettings.Transport == ArterySettings.AeronUpd
val port = SocketUtil.temporaryLocalPort(useUdp)
val config = ConfigFactory.parseString(s"""
|akka {
| actor {