-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reimplement fix for akka/pekko cluster #1594
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
7d2356d
Revert "revert #1568 due to test failures (#1587)"
pjfanning 2dbe5b1
temp run nightly test in this PR
pjfanning a2b8cc9
no need for square brackets because the set print adds them
pjfanning 17655ee
logging to find issue
pjfanning d890888
support tcp protocols
pjfanning 2783e3c
Update ClusterDaemon.scala
pjfanning e2894b5
remove temp logging
pjfanning a767289
try to fix issue in Remoting
pjfanning fe9d1d3
extra tests
pjfanning 77c9df3
more tests
pjfanning 516095e
ignore udp tests
pjfanning 3fe0646
try to make tests tidy up after failures
pjfanning a5d7ab6
Update MixedProtocolClusterSpec.scala
pjfanning bb117cf
Update MixedProtocolClusterSpec.scala
pjfanning 638ecf5
run main cluster tests for PR
pjfanning File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
192 changes: 192 additions & 0 deletions
192
cluster/src/test/scala/org/apache/pekko/cluster/MixedProtocolClusterSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.pekko.cluster | ||
|
||
import com.typesafe.config.{ Config, ConfigFactory } | ||
|
||
import org.apache.pekko.testkit.{ LongRunningTest, PekkoSpec } | ||
|
||
object MixedProtocolClusterSpec { | ||
|
||
val baseConfig: Config = | ||
ConfigFactory.parseString(""" | ||
pekko.actor.provider = "cluster" | ||
pekko.coordinated-shutdown.terminate-actor-system = on | ||
|
||
pekko.remote.artery.canonical.port = 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we need test both |
||
pekko.remote.classic.netty.tcp.port = 0 | ||
pekko.remote.artery.advanced.aeron.idle-cpu-level = 3 | ||
pekko.remote.accept-protocol-names = ["pekko", "akka"] | ||
|
||
pekko.cluster.jmx.multi-mbeans-in-same-jvm = on | ||
pekko.cluster.configuration-compatibility-check.enforce-on-join = off | ||
""") | ||
|
||
val configWithUdp: Config = | ||
ConfigFactory.parseString(""" | ||
pekko.remote.artery.transport = "aeron-udp" | ||
""").withFallback(baseConfig) | ||
|
||
val configWithPekkoUdp: Config = | ||
ConfigFactory.parseString(""" | ||
pekko.remote.protocol-name = "pekko" | ||
""").withFallback(configWithUdp) | ||
|
||
val configWithAkkaUdp: Config = | ||
ConfigFactory.parseString(""" | ||
pekko.remote.protocol-name = "akka" | ||
""").withFallback(configWithUdp) | ||
|
||
val configWithPekkoTcp: Config = | ||
ConfigFactory.parseString(""" | ||
pekko.remote.protocol-name = "pekko" | ||
""").withFallback(baseConfig) | ||
|
||
val configWithAkkaTcp: Config = | ||
ConfigFactory.parseString(""" | ||
pekko.remote.protocol-name = "akka" | ||
""").withFallback(baseConfig) | ||
|
||
val configWithNetty: Config = | ||
ConfigFactory.parseString(""" | ||
pekko.remote.artery.enabled = false | ||
pekko.remote.classic { | ||
enabled-transports = ["pekko.remote.classic.netty.tcp"] | ||
} | ||
""").withFallback(baseConfig) | ||
|
||
val configWithPekkoNetty: Config = | ||
ConfigFactory.parseString(""" | ||
pekko.remote.protocol-name = "pekko" | ||
""").withFallback(configWithNetty) | ||
|
||
val configWithAkkaNetty: Config = | ||
ConfigFactory.parseString(""" | ||
pekko.remote.protocol-name = "akka" | ||
""").withFallback(configWithNetty) | ||
} | ||
|
||
class MixedProtocolClusterSpec extends PekkoSpec with ClusterTestKit { | ||
|
||
import MixedProtocolClusterSpec._ | ||
|
||
"A node using the akka protocol" must { | ||
|
||
"be allowed to join a cluster with a node using the pekko protocol (udp)" taggedAs LongRunningTest in { | ||
|
||
val clusterTestUtil = new ClusterTestUtil(system.name) | ||
try { | ||
// start the first node with the "pekko" protocol | ||
clusterTestUtil.newActorSystem(configWithPekkoUdp) | ||
|
||
// have a node using the "akka" protocol join | ||
val joiningNode = clusterTestUtil.newActorSystem(configWithAkkaUdp) | ||
clusterTestUtil.formCluster() | ||
|
||
awaitCond(clusterTestUtil.isMemberUp(joiningNode), message = "awaiting joining node to be 'Up'") | ||
} finally { | ||
clusterTestUtil.shutdownAll() | ||
} | ||
} | ||
|
||
"be allowed to join a cluster with a node using the pekko protocol (tcp)" taggedAs LongRunningTest in { | ||
|
||
val clusterTestUtil = new ClusterTestUtil(system.name) | ||
try { | ||
// 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() | ||
|
||
awaitCond(clusterTestUtil.isMemberUp(joiningNode), message = "awaiting joining node to be 'Up'") | ||
} finally { | ||
clusterTestUtil.shutdownAll() | ||
} | ||
} | ||
|
||
"be allowed to join a cluster with a node using the pekko protocol (netty)" taggedAs LongRunningTest in { | ||
|
||
val clusterTestUtil = new ClusterTestUtil(system.name) | ||
try { | ||
// start the first node with the "pekko" protocol | ||
clusterTestUtil.newActorSystem(configWithPekkoNetty) | ||
|
||
// have a node using the "akka" protocol join | ||
val joiningNode = clusterTestUtil.newActorSystem(configWithAkkaNetty) | ||
clusterTestUtil.formCluster() | ||
|
||
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 (udp)" taggedAs LongRunningTest in { | ||
|
||
val clusterTestUtil = new ClusterTestUtil(system.name) | ||
try { | ||
// create the first node with the "akka" protocol | ||
clusterTestUtil.newActorSystem(configWithAkkaUdp) | ||
|
||
// have a node using the "pekko" protocol join | ||
val joiningNode = clusterTestUtil.newActorSystem(configWithPekkoUdp) | ||
clusterTestUtil.formCluster() | ||
|
||
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 (tcp)" taggedAs LongRunningTest in { | ||
|
||
val clusterTestUtil = new ClusterTestUtil(system.name) | ||
try { | ||
// 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() | ||
|
||
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 (netty)" taggedAs LongRunningTest in { | ||
|
||
val clusterTestUtil = new ClusterTestUtil(system.name) | ||
try { | ||
// create the first node with the "akka" protocol | ||
clusterTestUtil.newActorSystem(configWithAkkaNetty) | ||
|
||
// have a node using the "pekko" protocol join | ||
val joiningNode = clusterTestUtil.newActorSystem(configWithPekkoNetty) | ||
clusterTestUtil.formCluster() | ||
|
||
awaitCond(clusterTestUtil.isMemberUp(joiningNode), message = "awaiting joining node to be 'Up'") | ||
} finally { | ||
clusterTestUtil.shutdownAll() | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need
sbt cluster/MultiJvm/test
tooThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#1592 covers that. It looks like running the multiJvm tests will be more complicated. The aim of this small change is that the test modified in this PR runs in the PR CI - because at the momemt, it does not.