2012-05-25 17:29:29 +02:00
|
|
|
/**
|
|
|
|
|
* Copyright (C) 2009-2012 Typesafe Inc. <http://www.typesafe.com>
|
|
|
|
|
*/
|
|
|
|
|
package akka.cluster
|
|
|
|
|
|
|
|
|
|
import com.typesafe.config.ConfigFactory
|
|
|
|
|
import akka.remote.testkit.MultiNodeConfig
|
|
|
|
|
import akka.remote.testkit.MultiNodeSpec
|
|
|
|
|
import akka.testkit._
|
|
|
|
|
import akka.actor.Address
|
|
|
|
|
|
|
|
|
|
object ClientDowningNodeThatIsUnreachableMultiJvmSpec extends MultiNodeConfig {
|
2012-05-28 14:39:36 +02:00
|
|
|
val first = role("first")
|
2012-05-25 17:29:29 +02:00
|
|
|
val second = role("second")
|
2012-05-28 14:39:36 +02:00
|
|
|
val third = role("third")
|
2012-05-25 17:29:29 +02:00
|
|
|
val fourth = role("fourth")
|
|
|
|
|
|
2012-05-28 15:38:39 +02:00
|
|
|
commonConfig(debugConfig(on = false).withFallback(MultiNodeClusterSpec.clusterConfig))
|
2012-05-25 17:29:29 +02:00
|
|
|
}
|
|
|
|
|
|
2012-06-11 16:48:19 +02:00
|
|
|
class ClientDowningNodeThatIsUnreachableWithFailureDetectorPuppetMultiJvmNode1 extends ClientDowningNodeThatIsUnreachableSpec with FailureDetectorPuppetStrategy
|
|
|
|
|
class ClientDowningNodeThatIsUnreachableWithFailureDetectorPuppetMultiJvmNode2 extends ClientDowningNodeThatIsUnreachableSpec with FailureDetectorPuppetStrategy
|
|
|
|
|
class ClientDowningNodeThatIsUnreachableWithFailureDetectorPuppetMultiJvmNode3 extends ClientDowningNodeThatIsUnreachableSpec with FailureDetectorPuppetStrategy
|
|
|
|
|
class ClientDowningNodeThatIsUnreachableWithFailureDetectorPuppetMultiJvmNode4 extends ClientDowningNodeThatIsUnreachableSpec with FailureDetectorPuppetStrategy
|
|
|
|
|
|
|
|
|
|
class ClientDowningNodeThatIsUnreachableWithAccrualFailureDetectorMultiJvmNode1 extends ClientDowningNodeThatIsUnreachableSpec with AccrualFailureDetectorStrategy
|
|
|
|
|
class ClientDowningNodeThatIsUnreachableWithAccrualFailureDetectorMultiJvmNode2 extends ClientDowningNodeThatIsUnreachableSpec with AccrualFailureDetectorStrategy
|
|
|
|
|
class ClientDowningNodeThatIsUnreachableWithAccrualFailureDetectorMultiJvmNode3 extends ClientDowningNodeThatIsUnreachableSpec with AccrualFailureDetectorStrategy
|
|
|
|
|
class ClientDowningNodeThatIsUnreachableWithAccrualFailureDetectorMultiJvmNode4 extends ClientDowningNodeThatIsUnreachableSpec with AccrualFailureDetectorStrategy
|
2012-05-25 17:29:29 +02:00
|
|
|
|
2012-06-11 14:32:17 +02:00
|
|
|
abstract class ClientDowningNodeThatIsUnreachableSpec
|
2012-05-27 21:22:30 +02:00
|
|
|
extends MultiNodeSpec(ClientDowningNodeThatIsUnreachableMultiJvmSpec)
|
2012-06-04 23:21:28 +02:00
|
|
|
with MultiNodeClusterSpec {
|
|
|
|
|
|
2012-05-25 17:29:29 +02:00
|
|
|
import ClientDowningNodeThatIsUnreachableMultiJvmSpec._
|
|
|
|
|
|
|
|
|
|
"Client of a 4 node cluster" must {
|
|
|
|
|
|
|
|
|
|
"be able to DOWN a node that is UNREACHABLE (killed)" taggedAs LongRunningTest in {
|
2012-06-05 14:13:44 +02:00
|
|
|
val thirdAddress = node(third).address
|
|
|
|
|
awaitClusterUp(first, second, third, fourth)
|
2012-05-25 17:29:29 +02:00
|
|
|
|
2012-06-05 14:13:44 +02:00
|
|
|
runOn(first) {
|
2012-05-25 17:29:29 +02:00
|
|
|
// kill 'third' node
|
|
|
|
|
testConductor.shutdown(third, 0)
|
2012-06-11 16:48:19 +02:00
|
|
|
markNodeAsUnavailable(thirdAddress)
|
2012-05-25 17:29:29 +02:00
|
|
|
|
|
|
|
|
// mark 'third' node as DOWN
|
2012-05-27 21:22:30 +02:00
|
|
|
cluster.down(thirdAddress)
|
2012-05-25 17:29:29 +02:00
|
|
|
testConductor.enter("down-third-node")
|
|
|
|
|
|
2012-05-28 14:39:36 +02:00
|
|
|
awaitUpConvergence(numberOfMembers = 3, canNotBePartOfMemberRing = Seq(thirdAddress))
|
2012-05-27 21:22:30 +02:00
|
|
|
cluster.latestGossip.members.exists(_.address == thirdAddress) must be(false)
|
2012-05-25 17:29:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
runOn(third) {
|
2012-06-05 14:13:44 +02:00
|
|
|
testConductor.enter("down-third-node")
|
2012-05-25 17:29:29 +02:00
|
|
|
}
|
|
|
|
|
|
2012-05-27 21:22:30 +02:00
|
|
|
runOn(second, fourth) {
|
2012-05-25 17:29:29 +02:00
|
|
|
testConductor.enter("down-third-node")
|
|
|
|
|
|
2012-05-28 14:39:36 +02:00
|
|
|
awaitUpConvergence(numberOfMembers = 3, canNotBePartOfMemberRing = Seq(thirdAddress))
|
2012-05-25 17:29:29 +02:00
|
|
|
}
|
2012-06-05 14:13:44 +02:00
|
|
|
|
|
|
|
|
testConductor.enter("await-completion")
|
2012-05-25 17:29:29 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|