fixed ClusterShardingSpec
This commit is contained in:
parent
b3f4012746
commit
dffd7b0bbd
1 changed files with 31 additions and 31 deletions
|
|
@ -315,6 +315,26 @@ class ClusterShardingSpec extends MultiNodeSpec(ClusterShardingSpec) with STMult
|
||||||
enterBarrier("after-4")
|
enterBarrier("after-4")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"support proxy only mode" in within(10.seconds) {
|
||||||
|
runOn(second) {
|
||||||
|
val proxy = system.actorOf(ShardRegion.proxyProps(
|
||||||
|
typeName = "counter",
|
||||||
|
role = None,
|
||||||
|
coordinatorPath = "/user/counterCoordinator/singleton/coordinator",
|
||||||
|
retryInterval = 1.second,
|
||||||
|
bufferSize = 1000,
|
||||||
|
idExtractor = idExtractor,
|
||||||
|
shardResolver = shardResolver),
|
||||||
|
name = "regionProxy")
|
||||||
|
|
||||||
|
proxy ! Get(1)
|
||||||
|
expectMsg(2)
|
||||||
|
proxy ! Get(2)
|
||||||
|
expectMsg(4)
|
||||||
|
}
|
||||||
|
enterBarrier("after-5")
|
||||||
|
}
|
||||||
|
|
||||||
"failover shards on crashed node" in within(30 seconds) {
|
"failover shards on crashed node" in within(30 seconds) {
|
||||||
// mute logging of deadLetters during shutdown of systems
|
// mute logging of deadLetters during shutdown of systems
|
||||||
if (!log.isDebugEnabled)
|
if (!log.isDebugEnabled)
|
||||||
|
|
@ -345,7 +365,7 @@ class ClusterShardingSpec extends MultiNodeSpec(ClusterShardingSpec) with STMult
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enterBarrier("after-5")
|
enterBarrier("after-6")
|
||||||
}
|
}
|
||||||
|
|
||||||
"use third and fourth node" in within(15 seconds) {
|
"use third and fourth node" in within(15 seconds) {
|
||||||
|
|
@ -395,7 +415,7 @@ class ClusterShardingSpec extends MultiNodeSpec(ClusterShardingSpec) with STMult
|
||||||
lastSender.path should be(region.path / "4" / "4")
|
lastSender.path should be(region.path / "4" / "4")
|
||||||
}
|
}
|
||||||
|
|
||||||
enterBarrier("after-6")
|
enterBarrier("after-7")
|
||||||
}
|
}
|
||||||
|
|
||||||
"recover coordinator state after coordinator crash" in within(60 seconds) {
|
"recover coordinator state after coordinator crash" in within(60 seconds) {
|
||||||
|
|
@ -426,7 +446,7 @@ class ClusterShardingSpec extends MultiNodeSpec(ClusterShardingSpec) with STMult
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enterBarrier("after-7")
|
enterBarrier("after-8")
|
||||||
}
|
}
|
||||||
|
|
||||||
"rebalance to nodes with less shards" in within(60 seconds) {
|
"rebalance to nodes with less shards" in within(60 seconds) {
|
||||||
|
|
@ -458,31 +478,11 @@ class ClusterShardingSpec extends MultiNodeSpec(ClusterShardingSpec) with STMult
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enterBarrier("after-8")
|
enterBarrier("after-9")
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
"support proxy only mode" in within(10.seconds) {
|
|
||||||
runOn(sixth) {
|
|
||||||
val proxy = system.actorOf(ShardRegion.proxyProps(
|
|
||||||
typeName = "counter",
|
|
||||||
role = None,
|
|
||||||
coordinatorPath = "/user/counterCoordinator/singleton/coordinator",
|
|
||||||
retryInterval = 1.second,
|
|
||||||
bufferSize = 1000,
|
|
||||||
idExtractor = idExtractor,
|
|
||||||
shardResolver = shardResolver),
|
|
||||||
name = "regionProxy")
|
|
||||||
|
|
||||||
proxy ! Get(1)
|
|
||||||
expectMsg(2)
|
|
||||||
proxy ! Get(2)
|
|
||||||
expectMsg(4)
|
|
||||||
}
|
|
||||||
enterBarrier("after-9")
|
|
||||||
}
|
|
||||||
|
|
||||||
"easy to use with extensions" in within(50.seconds) {
|
"easy to use with extensions" in within(50.seconds) {
|
||||||
runOn(third, fourth, fifth, sixth) {
|
runOn(third, fourth, fifth, sixth) {
|
||||||
//#counter-start
|
//#counter-start
|
||||||
|
|
@ -531,7 +531,7 @@ class ClusterShardingSpec extends MultiNodeSpec(ClusterShardingSpec) with STMult
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enterBarrier("after-9")
|
enterBarrier("after-10")
|
||||||
|
|
||||||
}
|
}
|
||||||
"easy API for starting" in within(50.seconds) {
|
"easy API for starting" in within(50.seconds) {
|
||||||
|
|
@ -548,7 +548,7 @@ class ClusterShardingSpec extends MultiNodeSpec(ClusterShardingSpec) with STMult
|
||||||
|
|
||||||
counterRegionViaStart should equal(counterRegionViaGet)
|
counterRegionViaStart should equal(counterRegionViaGet)
|
||||||
}
|
}
|
||||||
enterBarrier("after-10")
|
enterBarrier("after-11")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -610,7 +610,7 @@ class ClusterShardingSpec extends MultiNodeSpec(ClusterShardingSpec) with STMult
|
||||||
expectMsg(3 seconds, ActorIdentity(3, None))
|
expectMsg(3 seconds, ActorIdentity(3, None))
|
||||||
|
|
||||||
}
|
}
|
||||||
enterBarrier("after-11")
|
enterBarrier("after-12")
|
||||||
}
|
}
|
||||||
|
|
||||||
"permanently stop entries which passivate" in within(15.seconds) {
|
"permanently stop entries which passivate" in within(15.seconds) {
|
||||||
|
|
@ -681,7 +681,7 @@ class ClusterShardingSpec extends MultiNodeSpec(ClusterShardingSpec) with STMult
|
||||||
expectMsgType[ActorIdentity](3 seconds).ref should not be (None)
|
expectMsgType[ActorIdentity](3 seconds).ref should not be (None)
|
||||||
}
|
}
|
||||||
|
|
||||||
enterBarrier("after-12")
|
enterBarrier("after-13")
|
||||||
}
|
}
|
||||||
|
|
||||||
"restart entries which stop without passivating" in within(50.seconds) {
|
"restart entries which stop without passivating" in within(50.seconds) {
|
||||||
|
|
@ -707,7 +707,7 @@ class ClusterShardingSpec extends MultiNodeSpec(ClusterShardingSpec) with STMult
|
||||||
}, 5.seconds, 500.millis)
|
}, 5.seconds, 500.millis)
|
||||||
}
|
}
|
||||||
|
|
||||||
enterBarrier("after-13")
|
enterBarrier("after-14")
|
||||||
}
|
}
|
||||||
|
|
||||||
"be migrated to new regions upon region failure" in within(15.seconds) {
|
"be migrated to new regions upon region failure" in within(15.seconds) {
|
||||||
|
|
@ -747,7 +747,7 @@ class ClusterShardingSpec extends MultiNodeSpec(ClusterShardingSpec) with STMult
|
||||||
expectMsg(2)
|
expectMsg(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
enterBarrier("after-14")
|
enterBarrier("after-15")
|
||||||
}
|
}
|
||||||
|
|
||||||
"ensure rebalance restarts shards" in within(50.seconds) {
|
"ensure rebalance restarts shards" in within(50.seconds) {
|
||||||
|
|
@ -783,7 +783,7 @@ class ClusterShardingSpec extends MultiNodeSpec(ClusterShardingSpec) with STMult
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enterBarrier("after-15")
|
enterBarrier("after-16")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue