Changed tests to use enterBarrier

This commit is contained in:
Björn Antonsson 2012-06-19 17:10:03 +02:00
parent 3db9f7eb41
commit 14184e99e9
3 changed files with 29 additions and 29 deletions

View file

@ -44,7 +44,7 @@ abstract class JoinTwoClustersSpec
runOn(a1, b1, c1) {
startClusterNode()
}
testConductor.enter("first-started")
enterBarrier("first-started")
runOn(a1, a2) {
cluster.join(a1Address)
@ -62,7 +62,7 @@ abstract class JoinTwoClustersSpec
assertLeader(b1, b2)
assertLeader(c1, c2)
testConductor.enter("two-members")
enterBarrier("two-members")
runOn(b2) {
cluster.join(a1Address)
@ -75,7 +75,7 @@ abstract class JoinTwoClustersSpec
assertLeader(a1, a2, b1, b2)
assertLeader(c1, c2)
testConductor.enter("four-members")
enterBarrier("four-members")
}
"be able to 'elect' a single leader after joining (C -> A + B)" taggedAs LongRunningTest in {
@ -88,7 +88,7 @@ abstract class JoinTwoClustersSpec
assertLeader(a1, a2, b1, b2, c1, c2)
testConductor.enter("six-members")
enterBarrier("six-members")
}
}
}

View file

@ -50,7 +50,7 @@ abstract class LeaderLeavingSpec
if (cluster.isLeader) {
cluster.leave(oldLeaderAddress)
testConductor.enter("leader-left")
enterBarrier("leader-left")
// verify that a NEW LEADER have taken over
awaitCond(!cluster.isLeader)
@ -63,7 +63,7 @@ abstract class LeaderLeavingSpec
} else {
testConductor.enter("leader-left")
enterBarrier("leader-left")
// verify that the LEADER is LEAVING
awaitCond(cluster.latestGossip.members.exists(m => m.status == MemberStatus.Leaving && m.address == oldLeaderAddress)) // wait on LEAVING
@ -81,7 +81,7 @@ abstract class LeaderLeavingSpec
awaitCond(cluster.leader != oldLeaderAddress)
}
testConductor.enter("finished")
enterBarrier("finished")
}
}
}

View file

@ -83,18 +83,18 @@ abstract class TransitionSpec
gossipBarrierCounter += 1
runOn(toRole) {
val g = cluster.latestGossip
testConductor.enter("before-gossip-" + gossipBarrierCounter)
enterBarrier("before-gossip-" + gossipBarrierCounter)
awaitCond(cluster.latestGossip != g) // received gossip
testConductor.enter("after-gossip-" + gossipBarrierCounter)
enterBarrier("after-gossip-" + gossipBarrierCounter)
}
runOn(fromRole) {
testConductor.enter("before-gossip-" + gossipBarrierCounter)
enterBarrier("before-gossip-" + gossipBarrierCounter)
cluster.gossipTo(node(toRole).address) // send gossip
testConductor.enter("after-gossip-" + gossipBarrierCounter)
enterBarrier("after-gossip-" + gossipBarrierCounter)
}
runOn(roles.filterNot(r r == fromRole || r == toRole): _*) {
testConductor.enter("before-gossip-" + gossipBarrierCounter)
testConductor.enter("after-gossip-" + gossipBarrierCounter)
enterBarrier("before-gossip-" + gossipBarrierCounter)
enterBarrier("after-gossip-" + gossipBarrierCounter)
}
}
}
@ -110,7 +110,7 @@ abstract class TransitionSpec
cluster.leaderActions()
cluster.status must be(Up)
testConductor.enter("after-1")
enterBarrier("after-1")
}
"perform correct transitions when second joining first" taggedAs LongRunningTest in {
@ -124,7 +124,7 @@ abstract class TransitionSpec
memberStatus(second) must be(Joining)
cluster.convergence.isDefined must be(false)
}
testConductor.enter("second-joined")
enterBarrier("second-joined")
first gossipTo second
runOn(second) {
@ -151,14 +151,14 @@ abstract class TransitionSpec
memberStatus(second) must be(Joining)
cluster.convergence.isDefined must be(true)
}
testConductor.enter("convergence-joining-2")
enterBarrier("convergence-joining-2")
runOn(leader(first, second)) {
cluster.leaderActions()
memberStatus(first) must be(Up)
memberStatus(second) must be(Up)
}
testConductor.enter("leader-actions-2")
enterBarrier("leader-actions-2")
leader(first, second) gossipTo nonLeader(first, second).head
runOn(nonLeader(first, second).head) {
@ -176,7 +176,7 @@ abstract class TransitionSpec
cluster.convergence.isDefined must be(true)
}
testConductor.enter("after-2")
enterBarrier("after-2")
}
"perform correct transitions when third joins second" taggedAs LongRunningTest in {
@ -190,7 +190,7 @@ abstract class TransitionSpec
memberStatus(third) must be(Joining)
seenLatestGossip must be(Set(second))
}
testConductor.enter("third-joined-second")
enterBarrier("third-joined-second")
second gossipTo first
runOn(first) {
@ -234,7 +234,7 @@ abstract class TransitionSpec
cluster.convergence.isDefined must be(true)
}
testConductor.enter("convergence-joining-3")
enterBarrier("convergence-joining-3")
runOn(leader(first, second, third)) {
cluster.leaderActions()
@ -242,7 +242,7 @@ abstract class TransitionSpec
memberStatus(second) must be(Up)
memberStatus(third) must be(Up)
}
testConductor.enter("leader-actions-3")
enterBarrier("leader-actions-3")
// leader gossipTo first non-leader
leader(first, second, third) gossipTo nonLeader(first, second, third).head
@ -281,7 +281,7 @@ abstract class TransitionSpec
cluster.convergence.isDefined must be(true)
}
testConductor.enter("after-3")
enterBarrier("after-3")
}
"startup a second separated cluster consisting of nodes fourth and fifth" taggedAs LongRunningTest in {
@ -299,9 +299,9 @@ abstract class TransitionSpec
cluster.gossipTo(fourth)
cluster.convergence.isDefined must be(true)
}
testConductor.enter("fourth-joined-fifth")
enterBarrier("fourth-joined-fifth")
testConductor.enter("after-4")
enterBarrier("after-4")
}
"perform correct transitions when second cluster (node fourth) joins first cluster (node third)" taggedAs LongRunningTest in {
@ -313,7 +313,7 @@ abstract class TransitionSpec
awaitMembers(first, second, third, fourth)
seenLatestGossip must be(Set(third))
}
testConductor.enter("fourth-joined-third")
enterBarrier("fourth-joined-third")
third gossipTo second
runOn(second) {
@ -365,7 +365,7 @@ abstract class TransitionSpec
memberStatus(fifth) must be(Up)
cluster.convergence.isDefined must be(true)
testConductor.enter("convergence-joining-3")
enterBarrier("convergence-joining-3")
runOn(leader(roles: _*)) {
cluster.leaderActions()
@ -378,7 +378,7 @@ abstract class TransitionSpec
x gossipTo y
}
testConductor.enter("spread-5")
enterBarrier("spread-5")
seenLatestGossip must be(roles.toSet)
memberStatus(first) must be(Up)
@ -388,7 +388,7 @@ abstract class TransitionSpec
memberStatus(fifth) must be(Up)
cluster.convergence.isDefined must be(true)
testConductor.enter("after-5")
enterBarrier("after-5")
}
"perform correct transitions when second becomes unavailble" taggedAs LongRunningTest in {
@ -428,7 +428,7 @@ abstract class TransitionSpec
cluster.convergence.isDefined must be(true)
}
testConductor.enter("after-6")
enterBarrier("after-6")
}
}