initialParticipants default as roles.size in cluster tests
This commit is contained in:
parent
6a380550f9
commit
56735477b8
22 changed files with 13 additions and 46 deletions
|
|
@ -31,10 +31,8 @@ abstract class LeaderElectionSpec
|
|||
|
||||
import LeaderElectionMultiJvmSpec._
|
||||
|
||||
override def initialParticipants = 5
|
||||
|
||||
// sorted in the order used by the cluster
|
||||
lazy val roles = Seq(first, second, third, fourth).sorted
|
||||
lazy val sortedRoles = Seq(first, second, third, fourth).sorted
|
||||
|
||||
"A cluster of four nodes" must {
|
||||
|
||||
|
|
@ -42,15 +40,15 @@ abstract class LeaderElectionSpec
|
|||
awaitClusterUp(first, second, third, fourth)
|
||||
|
||||
if (myself != controller) {
|
||||
cluster.isLeader must be(myself == roles.head)
|
||||
assertLeaderIn(roles)
|
||||
cluster.isLeader must be(myself == sortedRoles.head)
|
||||
assertLeaderIn(sortedRoles)
|
||||
}
|
||||
|
||||
testConductor.enter("after")
|
||||
}
|
||||
|
||||
def shutdownLeaderAndVerifyNewLeader(alreadyShutdown: Int): Unit = {
|
||||
val currentRoles = roles.drop(alreadyShutdown)
|
||||
val currentRoles = sortedRoles.drop(alreadyShutdown)
|
||||
currentRoles.size must be >= (2)
|
||||
val leader = currentRoles.head
|
||||
val aUser = currentRoles.last
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue