2013-01-14 14:09:53 +01:00
|
|
|
/**
|
2014-02-02 19:05:45 -06:00
|
|
|
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
|
2013-01-14 14:09:53 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
package akka.contrib.pattern
|
|
|
|
|
|
|
|
|
|
import language.postfixOps
|
|
|
|
|
import scala.collection.immutable
|
|
|
|
|
import scala.concurrent.duration._
|
|
|
|
|
import com.typesafe.config.ConfigFactory
|
|
|
|
|
import akka.actor.Actor
|
|
|
|
|
import akka.actor.ActorLogging
|
|
|
|
|
import akka.actor.ActorRef
|
2013-01-28 08:47:52 +01:00
|
|
|
import akka.actor.Address
|
2013-01-14 14:09:53 +01:00
|
|
|
import akka.actor.Props
|
|
|
|
|
import akka.actor.RootActorPath
|
|
|
|
|
import akka.cluster.Cluster
|
|
|
|
|
import akka.cluster.ClusterEvent._
|
|
|
|
|
import akka.cluster.Member
|
|
|
|
|
import akka.remote.testconductor.RoleName
|
|
|
|
|
import akka.remote.testkit.MultiNodeConfig
|
|
|
|
|
import akka.remote.testkit.MultiNodeSpec
|
|
|
|
|
import akka.remote.testkit.STMultiNodeSpec
|
|
|
|
|
import akka.testkit._
|
|
|
|
|
import akka.testkit.TestEvent._
|
|
|
|
|
import akka.actor.Terminated
|
2013-03-26 18:17:50 +01:00
|
|
|
import akka.actor.Identify
|
|
|
|
|
import akka.actor.ActorIdentity
|
|
|
|
|
import akka.actor.ActorSelection
|
2013-11-19 15:53:40 +01:00
|
|
|
import akka.cluster.MemberStatus
|
2013-01-14 14:09:53 +01:00
|
|
|
|
|
|
|
|
object ClusterSingletonManagerSpec extends MultiNodeConfig {
|
|
|
|
|
val controller = role("controller")
|
2013-03-14 20:32:43 +01:00
|
|
|
val observer = role("observer")
|
2013-01-14 14:09:53 +01:00
|
|
|
val first = role("first")
|
|
|
|
|
val second = role("second")
|
|
|
|
|
val third = role("third")
|
|
|
|
|
val fourth = role("fourth")
|
|
|
|
|
val fifth = role("fifth")
|
|
|
|
|
val sixth = role("sixth")
|
|
|
|
|
|
|
|
|
|
commonConfig(ConfigFactory.parseString("""
|
|
|
|
|
akka.loglevel = INFO
|
|
|
|
|
akka.actor.provider = "akka.cluster.ClusterActorRefProvider"
|
|
|
|
|
akka.remote.log-remote-lifecycle-events = off
|
2013-09-11 16:09:51 +02:00
|
|
|
akka.cluster.auto-down-unreachable-after = 0s
|
2013-01-14 14:09:53 +01:00
|
|
|
"""))
|
|
|
|
|
|
2013-03-14 20:32:43 +01:00
|
|
|
nodeConfig(first, second, third, fourth, fifth, sixth)(
|
|
|
|
|
ConfigFactory.parseString("akka.cluster.roles =[worker]"))
|
|
|
|
|
|
2013-01-14 14:09:53 +01:00
|
|
|
object PointToPointChannel {
|
|
|
|
|
case object RegisterConsumer
|
|
|
|
|
case object UnregisterConsumer
|
|
|
|
|
case object RegistrationOk
|
|
|
|
|
case object UnexpectedRegistration
|
|
|
|
|
case object UnregistrationOk
|
|
|
|
|
case object UnexpectedUnregistration
|
|
|
|
|
case object Reset
|
|
|
|
|
case object ResetOk
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This channel is extremly strict with regards to
|
|
|
|
|
* registration and unregistration of consumer to
|
|
|
|
|
* be able to detect misbehaviour (e.g. two active
|
|
|
|
|
* singleton instances).
|
|
|
|
|
*/
|
|
|
|
|
class PointToPointChannel extends Actor with ActorLogging {
|
|
|
|
|
import PointToPointChannel._
|
|
|
|
|
|
|
|
|
|
def receive = idle
|
|
|
|
|
|
|
|
|
|
def idle: Receive = {
|
|
|
|
|
case RegisterConsumer ⇒
|
2014-01-16 15:16:35 +01:00
|
|
|
log.info("RegisterConsumer: [{}]", sender().path)
|
|
|
|
|
sender() ! RegistrationOk
|
|
|
|
|
context.become(active(sender()))
|
2013-01-14 14:09:53 +01:00
|
|
|
case UnregisterConsumer ⇒
|
2014-01-16 15:16:35 +01:00
|
|
|
log.info("UnexpectedUnregistration: [{}]", sender().path)
|
|
|
|
|
sender() ! UnexpectedUnregistration
|
2013-01-14 14:09:53 +01:00
|
|
|
context stop self
|
2014-01-16 15:16:35 +01:00
|
|
|
case Reset ⇒ sender() ! ResetOk
|
2013-01-14 14:09:53 +01:00
|
|
|
case msg ⇒ // no consumer, drop
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def active(consumer: ActorRef): Receive = {
|
2014-01-16 15:16:35 +01:00
|
|
|
case UnregisterConsumer if sender() == consumer ⇒
|
|
|
|
|
log.info("UnregistrationOk: [{}]", sender().path)
|
|
|
|
|
sender() ! UnregistrationOk
|
2013-01-14 14:09:53 +01:00
|
|
|
context.become(idle)
|
|
|
|
|
case UnregisterConsumer ⇒
|
2014-01-16 15:16:35 +01:00
|
|
|
log.info("UnexpectedUnregistration: [{}], expected [{}]", sender().path, consumer.path)
|
|
|
|
|
sender() ! UnexpectedUnregistration
|
2013-01-14 14:09:53 +01:00
|
|
|
context stop self
|
|
|
|
|
case RegisterConsumer ⇒
|
2014-01-16 15:16:35 +01:00
|
|
|
log.info("Unexpected RegisterConsumer [{}], active consumer [{}]", sender().path, consumer.path)
|
|
|
|
|
sender() ! UnexpectedRegistration
|
2013-01-14 14:09:53 +01:00
|
|
|
context stop self
|
|
|
|
|
case Reset ⇒
|
|
|
|
|
context.become(idle)
|
2014-01-16 15:16:35 +01:00
|
|
|
sender() ! ResetOk
|
2013-01-14 14:09:53 +01:00
|
|
|
case msg ⇒ consumer ! msg
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
object Consumer {
|
|
|
|
|
case object End
|
|
|
|
|
case object GetCurrent
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The Singleton actor
|
|
|
|
|
*/
|
2013-09-10 13:35:51 +02:00
|
|
|
class Consumer(queue: ActorRef, delegateTo: ActorRef) extends Actor {
|
2013-01-14 14:09:53 +01:00
|
|
|
import Consumer._
|
|
|
|
|
import PointToPointChannel._
|
|
|
|
|
|
2013-09-10 13:35:51 +02:00
|
|
|
var current = 0
|
2013-01-14 14:09:53 +01:00
|
|
|
|
|
|
|
|
override def preStart(): Unit = queue ! RegisterConsumer
|
|
|
|
|
|
|
|
|
|
def receive = {
|
|
|
|
|
case n: Int if n <= current ⇒
|
|
|
|
|
context.stop(self)
|
|
|
|
|
case n: Int ⇒
|
|
|
|
|
current = n
|
|
|
|
|
delegateTo ! n
|
|
|
|
|
case x @ (RegistrationOk | UnexpectedRegistration) ⇒
|
|
|
|
|
delegateTo ! x
|
|
|
|
|
case GetCurrent ⇒
|
2014-01-16 15:16:35 +01:00
|
|
|
sender() ! current
|
2013-01-14 14:09:53 +01:00
|
|
|
//#consumer-end
|
|
|
|
|
case End ⇒
|
|
|
|
|
queue ! UnregisterConsumer
|
|
|
|
|
case UnregistrationOk ⇒
|
|
|
|
|
context stop self
|
|
|
|
|
//#consumer-end
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-04-28 22:05:40 +02:00
|
|
|
// documentation of how to keep track of the oldest member in user land
|
2013-01-28 08:47:52 +01:00
|
|
|
//#singleton-proxy
|
|
|
|
|
class ConsumerProxy extends Actor {
|
2013-05-29 17:20:18 +02:00
|
|
|
|
2013-04-28 22:05:40 +02:00
|
|
|
// subscribe to MemberEvent, re-subscribe when restart
|
2013-01-28 08:47:52 +01:00
|
|
|
override def preStart(): Unit =
|
2013-04-28 22:05:40 +02:00
|
|
|
Cluster(context.system).subscribe(self, classOf[MemberEvent])
|
2013-03-14 20:32:43 +01:00
|
|
|
override def postStop(): Unit =
|
|
|
|
|
Cluster(context.system).unsubscribe(self)
|
|
|
|
|
|
|
|
|
|
val role = "worker"
|
2013-04-28 22:05:40 +02:00
|
|
|
// sort by age, oldest first
|
|
|
|
|
val ageOrdering = Ordering.fromLessThan[Member] { (a, b) ⇒ a.isOlderThan(b) }
|
2013-05-29 17:20:18 +02:00
|
|
|
var membersByAge: immutable.SortedSet[Member] =
|
|
|
|
|
immutable.SortedSet.empty(ageOrdering)
|
2013-03-14 20:32:43 +01:00
|
|
|
|
|
|
|
|
def receive = {
|
2013-04-28 22:05:40 +02:00
|
|
|
case state: CurrentClusterState ⇒
|
2013-11-19 15:53:40 +01:00
|
|
|
membersByAge = immutable.SortedSet.empty(ageOrdering) ++ state.members.filter(m ⇒
|
|
|
|
|
m.status == MemberStatus.Up && m.hasRole(role))
|
2013-05-23 11:09:32 +02:00
|
|
|
case MemberUp(m) ⇒ if (m.hasRole(role)) membersByAge += m
|
|
|
|
|
case MemberRemoved(m, _) ⇒ if (m.hasRole(role)) membersByAge -= m
|
2014-01-16 15:16:35 +01:00
|
|
|
case other ⇒ consumer foreach { _.tell(other, sender()) }
|
2013-03-14 20:32:43 +01:00
|
|
|
}
|
|
|
|
|
|
2013-03-26 18:17:50 +01:00
|
|
|
def consumer: Option[ActorSelection] =
|
2013-05-29 17:20:18 +02:00
|
|
|
membersByAge.headOption map (m ⇒ context.actorSelection(
|
|
|
|
|
RootActorPath(m.address) / "user" / "singleton" / "consumer"))
|
2013-03-14 20:32:43 +01:00
|
|
|
}
|
2013-04-28 22:05:40 +02:00
|
|
|
//#singleton-proxy
|
2013-03-14 20:32:43 +01:00
|
|
|
|
2013-01-14 14:09:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class ClusterSingletonManagerMultiJvmNode1 extends ClusterSingletonManagerSpec
|
|
|
|
|
class ClusterSingletonManagerMultiJvmNode2 extends ClusterSingletonManagerSpec
|
|
|
|
|
class ClusterSingletonManagerMultiJvmNode3 extends ClusterSingletonManagerSpec
|
|
|
|
|
class ClusterSingletonManagerMultiJvmNode4 extends ClusterSingletonManagerSpec
|
|
|
|
|
class ClusterSingletonManagerMultiJvmNode5 extends ClusterSingletonManagerSpec
|
|
|
|
|
class ClusterSingletonManagerMultiJvmNode6 extends ClusterSingletonManagerSpec
|
|
|
|
|
class ClusterSingletonManagerMultiJvmNode7 extends ClusterSingletonManagerSpec
|
2013-03-14 20:32:43 +01:00
|
|
|
class ClusterSingletonManagerMultiJvmNode8 extends ClusterSingletonManagerSpec
|
2013-01-14 14:09:53 +01:00
|
|
|
|
|
|
|
|
class ClusterSingletonManagerSpec extends MultiNodeSpec(ClusterSingletonManagerSpec) with STMultiNodeSpec with ImplicitSender {
|
|
|
|
|
import ClusterSingletonManagerSpec._
|
|
|
|
|
import ClusterSingletonManagerSpec.PointToPointChannel._
|
|
|
|
|
import ClusterSingletonManagerSpec.Consumer._
|
|
|
|
|
|
|
|
|
|
override def initialParticipants = roles.size
|
|
|
|
|
|
2013-03-26 18:17:50 +01:00
|
|
|
val identifyProbe = TestProbe()
|
|
|
|
|
|
2013-05-24 14:43:01 +02:00
|
|
|
val controllerRootActorPath = node(controller)
|
|
|
|
|
|
2013-03-26 18:17:50 +01:00
|
|
|
def queue: ActorRef = {
|
2013-05-24 14:43:01 +02:00
|
|
|
// this is used from inside actor construction, i.e. other thread, and must therefore not call `node(controller`
|
|
|
|
|
system.actorSelection(controllerRootActorPath / "user" / "queue").tell(Identify("queue"), identifyProbe.ref)
|
2013-03-26 18:17:50 +01:00
|
|
|
identifyProbe.expectMsgType[ActorIdentity].ref.get
|
|
|
|
|
}
|
2013-01-14 14:09:53 +01:00
|
|
|
|
2013-03-05 10:47:11 +01:00
|
|
|
def join(from: RoleName, to: RoleName): Unit = {
|
|
|
|
|
runOn(from) {
|
|
|
|
|
Cluster(system) join node(to).address
|
2013-03-14 20:32:43 +01:00
|
|
|
if (Cluster(system).selfRoles.contains("worker")) createSingleton()
|
2013-03-05 10:47:11 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-04-28 22:05:40 +02:00
|
|
|
def awaitMemberUp(memberProbe: TestProbe, nodes: RoleName*): Unit = {
|
|
|
|
|
runOn(nodes.filterNot(_ == nodes.head): _*) {
|
2013-12-17 14:25:56 +01:00
|
|
|
memberProbe.expectMsgType[MemberUp](15.seconds).member.address should be(node(nodes.head).address)
|
2013-04-28 22:05:40 +02:00
|
|
|
}
|
|
|
|
|
runOn(nodes.head) {
|
2013-12-17 14:25:56 +01:00
|
|
|
memberProbe.receiveN(nodes.size, 15.seconds).collect { case MemberUp(m) ⇒ m.address }.toSet should be(
|
2013-04-28 22:05:40 +02:00
|
|
|
nodes.map(node(_).address).toSet)
|
|
|
|
|
}
|
|
|
|
|
enterBarrier(nodes.head.name + "-up")
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-14 14:09:53 +01:00
|
|
|
def createSingleton(): ActorRef = {
|
|
|
|
|
//#create-singleton-manager
|
2013-04-17 22:14:19 +02:00
|
|
|
system.actorOf(ClusterSingletonManager.props(
|
2013-09-10 13:35:51 +02:00
|
|
|
singletonProps = Props(classOf[Consumer], queue, testActor),
|
2013-01-14 14:09:53 +01:00
|
|
|
singletonName = "consumer",
|
2013-03-14 20:32:43 +01:00
|
|
|
terminationMessage = End,
|
2013-04-17 22:14:19 +02:00
|
|
|
role = Some("worker")),
|
2013-01-14 14:09:53 +01:00
|
|
|
name = "singleton")
|
|
|
|
|
//#create-singleton-manager
|
|
|
|
|
}
|
|
|
|
|
|
2013-04-28 22:05:40 +02:00
|
|
|
def consumer(oldest: RoleName): ActorSelection =
|
|
|
|
|
system.actorSelection(RootActorPath(node(oldest).address) / "user" / "singleton" / "consumer")
|
2013-01-14 14:09:53 +01:00
|
|
|
|
2013-09-10 13:35:51 +02:00
|
|
|
def verifyRegistration(oldest: RoleName): Unit = {
|
2013-04-28 22:05:40 +02:00
|
|
|
enterBarrier("before-" + oldest.name + "-registration-verified")
|
|
|
|
|
runOn(oldest) {
|
2013-01-14 14:09:53 +01:00
|
|
|
expectMsg(RegistrationOk)
|
2013-04-28 22:05:40 +02:00
|
|
|
consumer(oldest) ! GetCurrent
|
2013-09-10 13:35:51 +02:00
|
|
|
expectMsg(0)
|
2013-01-14 14:09:53 +01:00
|
|
|
}
|
2013-04-28 22:05:40 +02:00
|
|
|
enterBarrier("after-" + oldest.name + "-registration-verified")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def verifyMsg(oldest: RoleName, msg: Int): Unit = {
|
|
|
|
|
enterBarrier("before-" + msg + "-verified")
|
2013-01-14 14:09:53 +01:00
|
|
|
|
|
|
|
|
runOn(controller) {
|
|
|
|
|
queue ! msg
|
|
|
|
|
// make sure it's not terminated, which would be wrong
|
|
|
|
|
expectNoMsg(1 second)
|
|
|
|
|
}
|
2013-04-28 22:05:40 +02:00
|
|
|
runOn(oldest) {
|
|
|
|
|
expectMsg(5.seconds, msg)
|
2013-01-14 14:09:53 +01:00
|
|
|
}
|
2013-04-28 22:05:40 +02:00
|
|
|
runOn(roles.filterNot(r ⇒ r == oldest || r == controller || r == observer): _*) {
|
2013-01-14 14:09:53 +01:00
|
|
|
expectNoMsg(1 second)
|
|
|
|
|
}
|
2013-04-28 22:05:40 +02:00
|
|
|
enterBarrier("after-" + msg + "-verified")
|
2013-01-14 14:09:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def crash(roles: RoleName*): Unit = {
|
|
|
|
|
runOn(controller) {
|
|
|
|
|
queue ! Reset
|
|
|
|
|
expectMsg(ResetOk)
|
|
|
|
|
roles foreach { r ⇒
|
|
|
|
|
log.info("Shutdown [{}]", node(r).address)
|
2013-04-23 16:44:14 +02:00
|
|
|
testConductor.exit(r, 0).await
|
2013-01-14 14:09:53 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
"A ClusterSingletonManager" must {
|
|
|
|
|
|
2013-04-28 22:05:40 +02:00
|
|
|
"startup 6 node cluster" in within(60 seconds) {
|
|
|
|
|
|
|
|
|
|
val memberProbe = TestProbe()
|
|
|
|
|
Cluster(system).subscribe(memberProbe.ref, classOf[MemberUp])
|
|
|
|
|
memberProbe.expectMsgClass(classOf[CurrentClusterState])
|
2013-01-14 14:09:53 +01:00
|
|
|
|
|
|
|
|
runOn(controller) {
|
|
|
|
|
// watch that it is not terminated, which would indicate misbehaviour
|
|
|
|
|
watch(system.actorOf(Props[PointToPointChannel], "queue"))
|
|
|
|
|
}
|
|
|
|
|
enterBarrier("queue-started")
|
|
|
|
|
|
2013-04-28 22:05:40 +02:00
|
|
|
join(first, first)
|
|
|
|
|
awaitMemberUp(memberProbe, first)
|
2013-09-10 13:35:51 +02:00
|
|
|
verifyRegistration(first)
|
2013-04-28 22:05:40 +02:00
|
|
|
verifyMsg(first, msg = 1)
|
2013-03-14 20:32:43 +01:00
|
|
|
|
|
|
|
|
// join the observer node as well, which should not influence since it doesn't have the "worker" role
|
2013-04-28 22:05:40 +02:00
|
|
|
join(observer, first)
|
|
|
|
|
awaitMemberUp(memberProbe, observer, first)
|
2013-01-14 14:09:53 +01:00
|
|
|
|
2013-04-28 22:05:40 +02:00
|
|
|
join(second, first)
|
|
|
|
|
awaitMemberUp(memberProbe, second, observer, first)
|
|
|
|
|
verifyMsg(first, msg = 2)
|
2013-01-14 14:09:53 +01:00
|
|
|
|
2013-04-28 22:05:40 +02:00
|
|
|
join(third, first)
|
|
|
|
|
awaitMemberUp(memberProbe, third, second, observer, first)
|
|
|
|
|
verifyMsg(first, msg = 3)
|
2013-01-14 14:09:53 +01:00
|
|
|
|
2013-04-28 22:05:40 +02:00
|
|
|
join(fourth, first)
|
|
|
|
|
awaitMemberUp(memberProbe, fourth, third, second, observer, first)
|
|
|
|
|
verifyMsg(first, msg = 4)
|
2013-01-14 14:09:53 +01:00
|
|
|
|
2013-04-28 22:05:40 +02:00
|
|
|
join(fifth, first)
|
|
|
|
|
awaitMemberUp(memberProbe, fifth, fourth, third, second, observer, first)
|
|
|
|
|
verifyMsg(first, msg = 5)
|
2013-03-05 10:47:11 +01:00
|
|
|
|
2013-04-28 22:05:40 +02:00
|
|
|
join(sixth, first)
|
|
|
|
|
awaitMemberUp(memberProbe, sixth, fifth, fourth, third, second, observer, first)
|
|
|
|
|
verifyMsg(first, msg = 6)
|
|
|
|
|
|
|
|
|
|
enterBarrier("after-1")
|
2013-01-14 14:09:53 +01:00
|
|
|
}
|
|
|
|
|
|
2013-04-28 22:05:40 +02:00
|
|
|
"hand over when oldest leaves in 6 nodes cluster " in within(30 seconds) {
|
|
|
|
|
val leaveRole = first
|
|
|
|
|
val newOldestRole = second
|
2013-01-14 14:09:53 +01:00
|
|
|
|
|
|
|
|
runOn(leaveRole) {
|
|
|
|
|
Cluster(system) leave node(leaveRole).address
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-10 13:35:51 +02:00
|
|
|
verifyRegistration(second)
|
2013-04-28 22:05:40 +02:00
|
|
|
verifyMsg(second, msg = 7)
|
2013-01-14 14:09:53 +01:00
|
|
|
|
|
|
|
|
runOn(leaveRole) {
|
2013-03-26 18:17:50 +01:00
|
|
|
system.actorSelection("/user/singleton").tell(Identify("singleton"), identifyProbe.ref)
|
|
|
|
|
identifyProbe.expectMsgPF() {
|
|
|
|
|
case ActorIdentity("singleton", None) ⇒ // already terminated
|
|
|
|
|
case ActorIdentity("singleton", Some(singleton)) ⇒
|
|
|
|
|
watch(singleton)
|
2013-04-09 14:48:17 +02:00
|
|
|
expectTerminated(singleton)
|
2013-03-26 18:17:50 +01:00
|
|
|
}
|
2013-01-14 14:09:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enterBarrier("after-leave")
|
|
|
|
|
}
|
|
|
|
|
|
2013-04-28 22:05:40 +02:00
|
|
|
"take over when oldest crashes in 5 nodes cluster" in within(60 seconds) {
|
2013-05-28 09:02:03 +02:00
|
|
|
// mute logging of deadLetters during shutdown of systems
|
|
|
|
|
if (!log.isDebugEnabled)
|
|
|
|
|
system.eventStream.publish(Mute(DeadLettersFilter[Any]))
|
2013-01-14 14:09:53 +01:00
|
|
|
enterBarrier("logs-muted")
|
|
|
|
|
|
2013-04-28 22:05:40 +02:00
|
|
|
crash(second)
|
2013-09-10 13:35:51 +02:00
|
|
|
verifyRegistration(third)
|
2013-04-28 22:05:40 +02:00
|
|
|
verifyMsg(third, msg = 8)
|
2013-01-14 14:09:53 +01:00
|
|
|
}
|
|
|
|
|
|
2013-04-28 22:05:40 +02:00
|
|
|
"take over when two oldest crash in 3 nodes cluster" in within(60 seconds) {
|
|
|
|
|
crash(third, fourth)
|
2013-09-10 13:35:51 +02:00
|
|
|
verifyRegistration(fifth)
|
2013-04-28 22:05:40 +02:00
|
|
|
verifyMsg(fifth, msg = 9)
|
2013-01-14 14:09:53 +01:00
|
|
|
}
|
|
|
|
|
|
2013-04-28 22:05:40 +02:00
|
|
|
"take over when oldest crashes in 2 nodes cluster" in within(60 seconds) {
|
|
|
|
|
crash(fifth)
|
2013-09-10 13:35:51 +02:00
|
|
|
verifyRegistration(sixth)
|
2013-04-28 22:05:40 +02:00
|
|
|
verifyMsg(sixth, msg = 10)
|
2013-01-14 14:09:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|