Refactor cluster startup join in tests and fix barrier race

* Refactored common code to MultiNodeClusterSpec.awaitClusterUp
* Fixed some race conditions of barriers
This commit is contained in:
Patrik Nordwall 2012-06-05 14:13:44 +02:00
parent 5ccfb2cfee
commit f02793ebd6
18 changed files with 85 additions and 208 deletions

View file

@ -35,16 +35,7 @@ abstract class NodeShutdownSpec extends MultiNodeSpec(NodeShutdownMultiJvmSpec)
"A cluster of 2 nodes" must {
"not be singleton cluster when joined" taggedAs LongRunningTest in {
// make sure that the node-to-join is started before other join
runOn(first) {
startClusterNode()
}
testConductor.enter("first-started")
runOn(second) {
cluster.join(node(first).address)
}
awaitUpConvergence(numberOfMembers = 2)
awaitClusterUp(first, second)
cluster.isSingletonCluster must be(false)
assertLeader(first, second)