Make multi node tests use the within() aware barrier

This commit is contained in:
Björn Antonsson 2012-06-13 14:55:33 +02:00
parent 463e62926e
commit 5714d8327f
25 changed files with 90 additions and 90 deletions

View file

@ -50,7 +50,7 @@ abstract class LeaderElectionSpec
assertLeaderIn(sortedRoles)
}
testConductor.enter("after")
enter("after")
}
def shutdownLeaderAndVerifyNewLeader(alreadyShutdown: Int): Unit = {
@ -64,33 +64,33 @@ abstract class LeaderElectionSpec
case `controller`
val leaderAddress = node(leader).address
testConductor.enter("before-shutdown")
enter("before-shutdown")
testConductor.shutdown(leader, 0)
testConductor.enter("after-shutdown", "after-down", "completed")
enter("after-shutdown", "after-down", "completed")
markNodeAsUnavailable(leaderAddress)
case `leader`
testConductor.enter("before-shutdown", "after-shutdown")
enter("before-shutdown", "after-shutdown")
// this node will be shutdown by the controller and doesn't participate in more barriers
case `aUser`
val leaderAddress = node(leader).address
testConductor.enter("before-shutdown", "after-shutdown")
enter("before-shutdown", "after-shutdown")
// user marks the shutdown leader as DOWN
cluster.down(leaderAddress)
testConductor.enter("after-down", "completed")
enter("after-down", "completed")
markNodeAsUnavailable(leaderAddress)
case _ if remainingRoles.contains(myself)
// remaining cluster nodes, not shutdown
testConductor.enter("before-shutdown", "after-shutdown", "after-down")
enter("before-shutdown", "after-shutdown", "after-down")
awaitUpConvergence(currentRoles.size - 1)
val nextExpectedLeader = remainingRoles.head
cluster.isLeader must be(myself == nextExpectedLeader)
assertLeaderIn(remainingRoles)
testConductor.enter("completed")
enter("completed")
}
}