Skip to content

Commit 7044f70

Browse files
committed
try to make tests tidy up after failures
1 parent abf435f commit 7044f70

File tree

1 file changed

+36
-39
lines changed

1 file changed

+36
-39
lines changed

cluster/src/test/scala/org/apache/pekko/cluster/MixedProtocolClusterSpec.scala

Lines changed: 36 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,14 @@ class MixedProtocolClusterSpec extends PekkoSpec with ClusterTestKit {
9595
"be allowed to join a cluster with a node using the pekko protocol (udp)" taggedAs LongRunningTest ignore {
9696

9797
val clusterTestUtil = new ClusterTestUtil(system.name)
98-
// start the first node with the "pekko" protocol
99-
clusterTestUtil.newActorSystem(configWithPekkoUdp)
98+
try {
99+
// start the first node with the "pekko" protocol
100+
clusterTestUtil.newActorSystem(configWithPekkoUdp)
100101

101-
// have a node using the "akka" protocol join
102-
val joiningNode = clusterTestUtil.newActorSystem(configWithAkkaUdp)
103-
clusterTestUtil.formCluster()
102+
// have a node using the "akka" protocol join
103+
val joiningNode = clusterTestUtil.newActorSystem(configWithAkkaUdp)
104+
clusterTestUtil.formCluster()
104105

105-
try {
106106
awaitCond(clusterTestUtil.isMemberUp(joiningNode), message = "awaiting joining node to be 'Up'")
107107
} finally {
108108
clusterTestUtil.shutdownAll()
@@ -112,14 +112,14 @@ class MixedProtocolClusterSpec extends PekkoSpec with ClusterTestKit {
112112
"be allowed to join a cluster with a node using the pekko protocol (tcp)" taggedAs LongRunningTest in {
113113

114114
val clusterTestUtil = new ClusterTestUtil(system.name)
115-
// start the first node with the "pekko" protocol
116-
clusterTestUtil.newActorSystem(configWithPekkoTcp)
115+
try {
116+
// start the first node with the "pekko" protocol
117+
clusterTestUtil.newActorSystem(configWithPekkoTcp)
117118

118-
// have a node using the "akka" protocol join
119-
val joiningNode = clusterTestUtil.newActorSystem(configWithAkkaTcp)
120-
clusterTestUtil.formCluster()
119+
// have a node using the "akka" protocol join
120+
val joiningNode = clusterTestUtil.newActorSystem(configWithAkkaTcp)
121+
clusterTestUtil.formCluster()
121122

122-
try {
123123
awaitCond(clusterTestUtil.isMemberUp(joiningNode), message = "awaiting joining node to be 'Up'")
124124
} finally {
125125
clusterTestUtil.shutdownAll()
@@ -129,14 +129,14 @@ class MixedProtocolClusterSpec extends PekkoSpec with ClusterTestKit {
129129
"be allowed to join a cluster with a node using the pekko protocol (netty)" taggedAs LongRunningTest in {
130130

131131
val clusterTestUtil = new ClusterTestUtil(system.name)
132-
// start the first node with the "pekko" protocol
133-
clusterTestUtil.newActorSystem(configWithPekkoNetty)
132+
try {
133+
// start the first node with the "pekko" protocol
134+
clusterTestUtil.newActorSystem(configWithPekkoNetty)
134135

135-
// have a node using the "akka" protocol join
136-
val joiningNode = clusterTestUtil.newActorSystem(configWithAkkaNetty)
137-
clusterTestUtil.formCluster()
136+
// have a node using the "akka" protocol join
137+
val joiningNode = clusterTestUtil.newActorSystem(configWithAkkaNetty)
138+
clusterTestUtil.formCluster()
138139

139-
try {
140140
awaitCond(clusterTestUtil.isMemberUp(joiningNode), message = "awaiting joining node to be 'Up'")
141141
} finally {
142142
clusterTestUtil.shutdownAll()
@@ -146,15 +146,14 @@ class MixedProtocolClusterSpec extends PekkoSpec with ClusterTestKit {
146146
"allow a node using the pekko protocol to join the cluster (udp)" taggedAs LongRunningTest ignore {
147147

148148
val clusterTestUtil = new ClusterTestUtil(system.name)
149+
try {
150+
// create the first node with the "akka" protocol
151+
clusterTestUtil.newActorSystem(configWithAkkaUdp)
149152

150-
// create the first node with the "akka" protocol
151-
clusterTestUtil.newActorSystem(configWithAkkaUdp)
152-
153-
// have a node using the "pekko" protocol join
154-
val joiningNode = clusterTestUtil.newActorSystem(configWithPekkoUdp)
155-
clusterTestUtil.formCluster()
153+
// have a node using the "pekko" protocol join
154+
val joiningNode = clusterTestUtil.newActorSystem(configWithPekkoUdp)
155+
clusterTestUtil.formCluster()
156156

157-
try {
158157
awaitCond(clusterTestUtil.isMemberUp(joiningNode), message = "awaiting joining node to be 'Up'")
159158
} finally {
160159
clusterTestUtil.shutdownAll()
@@ -164,15 +163,14 @@ class MixedProtocolClusterSpec extends PekkoSpec with ClusterTestKit {
164163
"allow a node using the pekko protocol to join the cluster (tcp)" taggedAs LongRunningTest in {
165164

166165
val clusterTestUtil = new ClusterTestUtil(system.name)
166+
try {
167+
// create the first node with the "akka" protocol
168+
clusterTestUtil.newActorSystem(configWithAkkaTcp)
167169

168-
// create the first node with the "akka" protocol
169-
clusterTestUtil.newActorSystem(configWithAkkaTcp)
170-
171-
// have a node using the "pekko" protocol join
172-
val joiningNode = clusterTestUtil.newActorSystem(configWithPekkoTcp)
173-
clusterTestUtil.formCluster()
170+
// have a node using the "pekko" protocol join
171+
val joiningNode = clusterTestUtil.newActorSystem(configWithPekkoTcp)
172+
clusterTestUtil.formCluster()
174173

175-
try {
176174
awaitCond(clusterTestUtil.isMemberUp(joiningNode), message = "awaiting joining node to be 'Up'")
177175
} finally {
178176
clusterTestUtil.shutdownAll()
@@ -182,15 +180,14 @@ class MixedProtocolClusterSpec extends PekkoSpec with ClusterTestKit {
182180
"allow a node using the pekko protocol to join the cluster (netty)" taggedAs LongRunningTest in {
183181

184182
val clusterTestUtil = new ClusterTestUtil(system.name)
183+
try {
184+
// create the first node with the "akka" protocol
185+
clusterTestUtil.newActorSystem(configWithAkkaNetty)
185186

186-
// create the first node with the "akka" protocol
187-
clusterTestUtil.newActorSystem(configWithAkkaNetty)
188-
189-
// have a node using the "pekko" protocol join
190-
val joiningNode = clusterTestUtil.newActorSystem(configWithPekkoNetty)
191-
clusterTestUtil.formCluster()
187+
// have a node using the "pekko" protocol join
188+
val joiningNode = clusterTestUtil.newActorSystem(configWithPekkoNetty)
189+
clusterTestUtil.formCluster()
192190

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

0 commit comments

Comments
 (0)