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 ClientDowningNodeThatIsUpMultiJvmSpec 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 ClientDowningNodeThatIsUpWithFailureDetectorPuppetMultiJvmNode1 extends ClientDowningNodeThatIsUpSpec with FailureDetectorPuppetStrategy
|
|
|
|
|
class ClientDowningNodeThatIsUpWithFailureDetectorPuppetMultiJvmNode2 extends ClientDowningNodeThatIsUpSpec with FailureDetectorPuppetStrategy
|
|
|
|
|
class ClientDowningNodeThatIsUpWithFailureDetectorPuppetMultiJvmNode3 extends ClientDowningNodeThatIsUpSpec with FailureDetectorPuppetStrategy
|
|
|
|
|
class ClientDowningNodeThatIsUpWithFailureDetectorPuppetMultiJvmNode4 extends ClientDowningNodeThatIsUpSpec with FailureDetectorPuppetStrategy
|
|
|
|
|
|
|
|
|
|
class ClientDowningNodeThatIsUpWithAccrualFailureDetectorMultiJvmNode1 extends ClientDowningNodeThatIsUpSpec with AccrualFailureDetectorStrategy
|
|
|
|
|
class ClientDowningNodeThatIsUpWithAccrualFailureDetectorMultiJvmNode2 extends ClientDowningNodeThatIsUpSpec with AccrualFailureDetectorStrategy
|
|
|
|
|
class ClientDowningNodeThatIsUpWithAccrualFailureDetectorMultiJvmNode3 extends ClientDowningNodeThatIsUpSpec with AccrualFailureDetectorStrategy
|
|
|
|
|
class ClientDowningNodeThatIsUpWithAccrualFailureDetectorMultiJvmNode4 extends ClientDowningNodeThatIsUpSpec with AccrualFailureDetectorStrategy
|
2012-05-25 17:29:29 +02:00
|
|
|
|
2012-06-11 14:32:17 +02:00
|
|
|
abstract class ClientDowningNodeThatIsUpSpec
|
2012-05-27 21:22:30 +02:00
|
|
|
extends MultiNodeSpec(ClientDowningNodeThatIsUpMultiJvmSpec)
|
2012-06-04 23:21:28 +02:00
|
|
|
with MultiNodeClusterSpec {
|
|
|
|
|
|
2012-05-25 17:29:29 +02:00
|
|
|
import ClientDowningNodeThatIsUpMultiJvmSpec._
|
|
|
|
|
|
|
|
|
|
"Client of a 4 node cluster" must {
|
|
|
|
|
|
|
|
|
|
"be able to DOWN a node that is UP (healthy and available)" taggedAs LongRunningTest in {
|
2012-06-18 11:54:44 +02:00
|
|
|
val thirdAddress = address(third)
|
2012-06-05 14:13:44 +02:00
|
|
|
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
|
|
|
// mark 'third' node as DOWN
|
2012-05-27 21:22:30 +02:00
|
|
|
cluster.down(thirdAddress)
|
2012-06-15 14:39:47 +02:00
|
|
|
enterBarrier("down-third-node")
|
2012-05-25 17:29:29 +02:00
|
|
|
|
2012-06-11 16:48:19 +02:00
|
|
|
markNodeAsUnavailable(thirdAddress)
|
|
|
|
|
|
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-15 14:39:47 +02:00
|
|
|
enterBarrier("down-third-node")
|
2012-05-25 17:29:29 +02:00
|
|
|
}
|
|
|
|
|
|
2012-05-27 21:22:30 +02:00
|
|
|
runOn(second, fourth) {
|
2012-06-15 14:39:47 +02:00
|
|
|
enterBarrier("down-third-node")
|
2012-05-25 17:29:29 +02:00
|
|
|
|
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
|
|
|
|
2012-06-15 14:39:47 +02:00
|
|
|
enterBarrier("await-completion")
|
2012-05-25 17:29:29 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|