Merge pull request #28677 from renatocaval/remoting-failed-to-bind

Reserve UPD or TPC ports according to artery config
This commit is contained in:
Patrik Nordwall 2020-03-09 13:31:25 +01:00 committed by GitHub
commit 1994a4b4f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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 {