Remove address vals in tests, fix race in TransitionSpec, see #2201

This commit is contained in:
Patrik Nordwall 2012-06-18 11:54:44 +02:00
parent fb04786072
commit 12e90a98dc
19 changed files with 53 additions and 94 deletions

View file

@ -36,10 +36,6 @@ abstract class NodeLeavingAndExitingSpec
import NodeLeavingAndExitingMultiJvmSpec._
lazy val firstAddress = node(first).address
lazy val secondAddress = node(second).address
lazy val thirdAddress = node(third).address
"A node that is LEAVING a non-singleton cluster" must {
// FIXME make it work and remove ignore
@ -48,7 +44,7 @@ abstract class NodeLeavingAndExitingSpec
awaitClusterUp(first, second, third)
runOn(first) {
cluster.leave(secondAddress)
cluster.leave(second)
}
testConductor.enter("second-left")
@ -60,13 +56,13 @@ abstract class NodeLeavingAndExitingSpec
awaitCond(cluster.latestGossip.members.exists(_.status == MemberStatus.Leaving)) // wait on LEAVING
val hasLeft = cluster.latestGossip.members.find(_.status == MemberStatus.Leaving) // verify node that left
hasLeft must be('defined)
hasLeft.get.address must be(secondAddress)
hasLeft.get.address must be(address(second))
// 2. Verify that 'second' node is set to EXITING
awaitCond(cluster.latestGossip.members.exists(_.status == MemberStatus.Exiting)) // wait on EXITING
val hasExited = cluster.latestGossip.members.find(_.status == MemberStatus.Exiting) // verify node that exited
hasExited must be('defined)
hasExited.get.address must be(secondAddress)
hasExited.get.address must be(address(second))
}
testConductor.enter("finished")