diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/NodeMembershipSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/NodeMembershipSpec.scala index 22c76cae67..de734088f1 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/NodeMembershipSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/NodeMembershipSpec.scala @@ -19,16 +19,9 @@ object NodeMembershipMultiJvmSpec extends MultiNodeConfig { gossip-frequency = 200 ms leader-actions-frequency = 200 ms periodic-tasks-initial-delay = 300 ms - # FIXME get rid of this hardcoded host:port - node-to-join = "akka://MultiNodeSpec@localhost:2602" } """))) - nodeConfig(first, ConfigFactory.parseString(""" - # FIXME get rid of this hardcoded port - akka.remote.netty.port=2602 - """)) - } class NodeMembershipMultiJvmNode1 extends NodeMembershipSpec @@ -55,6 +48,7 @@ abstract class NodeMembershipSpec extends MultiNodeSpec(NodeMembershipMultiJvmSp "(when two systems) start gossiping to each other so that both systems gets the same gossip info" in { runOn(first, second) { + node().join(firstAddress) awaitCond(node().latestGossip.members.size == 2) val members = node().latestGossip.members.toIndexedSeq members.size must be(2) @@ -70,6 +64,10 @@ abstract class NodeMembershipSpec extends MultiNodeSpec(NodeMembershipMultiJvmSp "(when three systems) start gossiping to each other so that both systems gets the same gossip info" in { + runOn(third) { + node().join(firstAddress) + } + // runOn all awaitCond(node().latestGossip.members.size == 3) val members = node().latestGossip.members.toIndexedSeq diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/NodeStartupSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/NodeStartupSpec.scala index 5f79d85ecb..8bb76fb613 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/NodeStartupSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/NodeStartupSpec.scala @@ -21,16 +21,6 @@ object NodeStartupMultiJvmSpec extends MultiNodeConfig { } """))) - nodeConfig(first, ConfigFactory.parseString(""" - # FIXME get rid of this hardcoded port - akka.remote.netty.port=2601 - """)) - - nodeConfig(second, ConfigFactory.parseString(""" - # FIXME get rid of this hardcoded host:port - akka.cluster.node-to-join = "akka://MultiNodeSpec@localhost:2601" - """)) - } class NodeStartupMultiJvmNode1 extends NodeStartupSpec @@ -47,6 +37,8 @@ abstract class NodeStartupSpec extends MultiNodeSpec(NodeStartupMultiJvmSpec) wi testConductor.enter("after") } + val firstAddress = testConductor.getAddressFor(first).await + "A first cluster node with a 'node-to-join' config set to empty string (singleton cluster)" must { "be a singleton cluster when started up" in { @@ -61,7 +53,7 @@ abstract class NodeStartupSpec extends MultiNodeSpec(NodeStartupMultiJvmSpec) wi runOn(first) { val members = node().latestGossip.members members.size must be(1) - val firstAddress = testConductor.getAddressFor(first).await + val joiningMember = members find (_.address == firstAddress) joiningMember must not be (None) joiningMember.get.status must be(MemberStatus.Joining) @@ -69,9 +61,13 @@ abstract class NodeStartupSpec extends MultiNodeSpec(NodeStartupMultiJvmSpec) wi } } - "A second cluster node with a 'node-to-join' config defined" must { + "A second cluster node" must { "join the other node cluster when sending a Join command" in { + runOn(second) { + node().join(firstAddress) + } + // runOn all val secondAddress = testConductor.getAddressFor(second).await awaitCond {