Skip to content

Commit

Permalink
extra tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning committed Dec 28, 2024
1 parent 542840d commit 1303acd
Showing 1 changed file with 47 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ object MixedProtocolClusterSpec {
pekko.actor.provider = "cluster"
pekko.coordinated-shutdown.terminate-actor-system = on
pekko.remote.classic.netty.tcp.port = 0
pekko.remote.artery.canonical.port = 0
pekko.remote.artery.advanced.aeron.idle-cpu-level = 3
pekko.remote.accept-protocol-names = ["pekko", "akka"]
Expand All @@ -42,10 +41,22 @@ object MixedProtocolClusterSpec {
pekko.remote.protocol-name = "pekko"
""").withFallback(baseConfig)

val configWithPekkoTcp: Config =
ConfigFactory.parseString("""
pekko.remote.classic.netty.tcp.port = 0
pekko.remote.protocol-name = "pekko"
""").withFallback(baseConfig)

val configWithAkka: Config =
ConfigFactory.parseString("""
pekko.remote.protocol-name = "akka"
""").withFallback(baseConfig)

val configWithAkkaTcp: Config =
ConfigFactory.parseString("""
pekko.remote.classic.netty.tcp.port = 0
pekko.remote.protocol-name = "akka"
""").withFallback(baseConfig)
}

class MixedProtocolClusterSpec extends PekkoSpec with ClusterTestKit {
Expand All @@ -71,6 +82,23 @@ class MixedProtocolClusterSpec extends PekkoSpec with ClusterTestKit {
}
}

"be allowed to join a cluster with a node using the pekko protocol (tcp)" taggedAs LongRunningTest in {

val clusterTestUtil = new ClusterTestUtil(system.name)
// start the first node with the "pekko" protocol
clusterTestUtil.newActorSystem(configWithPekkoTcp)

// have a node using the "akka" protocol join
val joiningNode = clusterTestUtil.newActorSystem(configWithAkkaTcp)
clusterTestUtil.formCluster()

try {
awaitCond(clusterTestUtil.isMemberUp(joiningNode), message = "awaiting joining node to be 'Up'")
} finally {
clusterTestUtil.shutdownAll()
}
}

"allow a node using the pekko protocol to join the cluster" taggedAs LongRunningTest in {

val clusterTestUtil = new ClusterTestUtil(system.name)
Expand All @@ -88,5 +116,23 @@ class MixedProtocolClusterSpec extends PekkoSpec with ClusterTestKit {
clusterTestUtil.shutdownAll()
}
}

"allow a node using the pekko protocol to join the cluster (tcp)" taggedAs LongRunningTest in {

val clusterTestUtil = new ClusterTestUtil(system.name)

// create the first node with the "akka" protocol
clusterTestUtil.newActorSystem(configWithAkkaTcp)

// have a node using the "pekko" protocol join
val joiningNode = clusterTestUtil.newActorSystem(configWithPekkoTcp)
clusterTestUtil.formCluster()

try {
awaitCond(clusterTestUtil.isMemberUp(joiningNode), message = "awaiting joining node to be 'Up'")
} finally {
clusterTestUtil.shutdownAll()
}
}
}
}

0 comments on commit 1303acd

Please sign in to comment.