Placed the barrier in after instead. See #1948
This commit is contained in:
parent
3e416a4b2c
commit
d3511d25a4
1 changed files with 16 additions and 15 deletions
|
|
@ -4,7 +4,7 @@
|
|||
package akka.cluster
|
||||
|
||||
import com.typesafe.config.ConfigFactory
|
||||
|
||||
import org.scalatest.BeforeAndAfter
|
||||
import akka.remote.testkit.MultiNodeConfig
|
||||
import akka.remote.testkit.MultiNodeSpec
|
||||
import akka.testkit._
|
||||
|
|
@ -13,43 +13,48 @@ object NodeStartupMultiJvmSpec extends MultiNodeConfig {
|
|||
val first = role("first")
|
||||
val second = role("second")
|
||||
|
||||
commonConfig(debugConfig(on = false).withFallback(ConfigFactory.parseString("""
|
||||
# FIXME get rid of this hardcoded host:port
|
||||
akka.cluster.node-to-join = "akka://MultiNodeSpec@localhost:2601"
|
||||
""")))
|
||||
commonConfig(debugConfig(on = false))
|
||||
|
||||
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
|
||||
class NodeStartupMultiJvmNode2 extends NodeStartupSpec
|
||||
|
||||
class NodeStartupSpec extends MultiNodeSpec(NodeStartupMultiJvmSpec) with ImplicitSender {
|
||||
class NodeStartupSpec extends MultiNodeSpec(NodeStartupMultiJvmSpec) with ImplicitSender with BeforeAndAfter {
|
||||
import NodeStartupMultiJvmSpec._
|
||||
|
||||
override def initialParticipants = 2
|
||||
|
||||
var firstNode: Cluster = _
|
||||
|
||||
after {
|
||||
testConductor.enter("after")
|
||||
}
|
||||
|
||||
runOn(first) {
|
||||
firstNode = Cluster(system)
|
||||
}
|
||||
|
||||
"A first cluster node with a 'node-to-join' config set to empty string (singleton cluster)" must {
|
||||
|
||||
"be a singleton cluster when started up" taggedAs LongRunningTest in {
|
||||
"be a singleton cluster when started up" in {
|
||||
runOn(first) {
|
||||
awaitCond(firstNode.isSingletonCluster)
|
||||
firstNode.convergence must be(None)
|
||||
}
|
||||
|
||||
testConductor.enter("done")
|
||||
}
|
||||
|
||||
"be in 'Joining' phase when started up" taggedAs LongRunningTest in {
|
||||
"be in 'Joining' phase when started up" in {
|
||||
runOn(first) {
|
||||
val members = firstNode.latestGossip.members
|
||||
members.size must be(1)
|
||||
|
|
@ -58,13 +63,11 @@ class NodeStartupSpec extends MultiNodeSpec(NodeStartupMultiJvmSpec) with Implic
|
|||
joiningMember must not be (None)
|
||||
joiningMember.get.status must be(MemberStatus.Joining)
|
||||
}
|
||||
|
||||
testConductor.enter("done")
|
||||
}
|
||||
}
|
||||
|
||||
"A second cluster node with a 'node-to-join' config defined" must {
|
||||
"join the other node cluster when sending a Join command" taggedAs LongRunningTest in {
|
||||
"join the other node cluster when sending a Join command" in {
|
||||
runOn(second) {
|
||||
// start cluster on second node, and join
|
||||
val secondNode = Cluster(system)
|
||||
|
|
@ -81,8 +84,6 @@ class NodeStartupSpec extends MultiNodeSpec(NodeStartupMultiJvmSpec) with Implic
|
|||
firstNode.latestGossip.members.size must be(2)
|
||||
awaitCond(firstNode.convergence.isDefined)
|
||||
}
|
||||
|
||||
testConductor.enter("done")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue