@@ -28,7 +28,6 @@ object MixedProtocolClusterSpec {
28
28
pekko.actor.provider = "cluster"
29
29
pekko.coordinated-shutdown.terminate-actor-system = on
30
30
31
- pekko.remote.classic.netty.tcp.port = 0
32
31
pekko.remote.artery.canonical.port = 0
33
32
pekko.remote.artery.advanced.aeron.idle-cpu-level = 3
34
33
pekko.remote.accept-protocol-names = ["pekko", "akka"]
@@ -42,10 +41,22 @@ object MixedProtocolClusterSpec {
42
41
pekko.remote.protocol-name = "pekko"
43
42
""" ).withFallback(baseConfig)
44
43
44
+ val configWithPekkoTcp : Config =
45
+ ConfigFactory .parseString("""
46
+ pekko.remote.classic.netty.tcp.port = 0
47
+ pekko.remote.protocol-name = "pekko"
48
+ """ ).withFallback(baseConfig)
49
+
45
50
val configWithAkka : Config =
46
51
ConfigFactory .parseString("""
47
52
pekko.remote.protocol-name = "akka"
48
53
""" ).withFallback(baseConfig)
54
+
55
+ val configWithAkkaTcp : Config =
56
+ ConfigFactory .parseString("""
57
+ pekko.remote.classic.netty.tcp.port = 0
58
+ pekko.remote.protocol-name = "akka"
59
+ """ ).withFallback(baseConfig)
49
60
}
50
61
51
62
class MixedProtocolClusterSpec extends PekkoSpec with ClusterTestKit {
@@ -71,6 +82,23 @@ class MixedProtocolClusterSpec extends PekkoSpec with ClusterTestKit {
71
82
}
72
83
}
73
84
85
+ " be allowed to join a cluster with a node using the pekko protocol (tcp)" taggedAs LongRunningTest in {
86
+
87
+ val clusterTestUtil = new ClusterTestUtil (system.name)
88
+ // start the first node with the "pekko" protocol
89
+ clusterTestUtil.newActorSystem(configWithPekkoTcp)
90
+
91
+ // have a node using the "akka" protocol join
92
+ val joiningNode = clusterTestUtil.newActorSystem(configWithAkkaTcp)
93
+ clusterTestUtil.formCluster()
94
+
95
+ try {
96
+ awaitCond(clusterTestUtil.isMemberUp(joiningNode), message = " awaiting joining node to be 'Up'" )
97
+ } finally {
98
+ clusterTestUtil.shutdownAll()
99
+ }
100
+ }
101
+
74
102
" allow a node using the pekko protocol to join the cluster" taggedAs LongRunningTest in {
75
103
76
104
val clusterTestUtil = new ClusterTestUtil (system.name)
@@ -88,5 +116,23 @@ class MixedProtocolClusterSpec extends PekkoSpec with ClusterTestKit {
88
116
clusterTestUtil.shutdownAll()
89
117
}
90
118
}
119
+
120
+ " allow a node using the pekko protocol to join the cluster (tcp)" taggedAs LongRunningTest in {
121
+
122
+ val clusterTestUtil = new ClusterTestUtil (system.name)
123
+
124
+ // create the first node with the "akka" protocol
125
+ clusterTestUtil.newActorSystem(configWithAkkaTcp)
126
+
127
+ // have a node using the "pekko" protocol join
128
+ val joiningNode = clusterTestUtil.newActorSystem(configWithPekkoTcp)
129
+ clusterTestUtil.formCluster()
130
+
131
+ try {
132
+ awaitCond(clusterTestUtil.isMemberUp(joiningNode), message = " awaiting joining node to be 'Up'" )
133
+ } finally {
134
+ clusterTestUtil.shutdownAll()
135
+ }
136
+ }
91
137
}
92
138
}
0 commit comments