parent
2f57153ee4
commit
e4aa3b6efc
1 changed files with 14 additions and 18 deletions
|
|
@ -76,30 +76,26 @@ abstract class ClusterShardingStatsSpec
|
|||
sharding.init(Entity(typeKey)(_ => Pinger()))
|
||||
enterBarrier("sharding started")
|
||||
|
||||
runOn(first) {
|
||||
val pongProbe = TestProbe[Pong]()
|
||||
val pongProbe = TestProbe[Pong]()
|
||||
|
||||
val entityRef1 = ClusterSharding(typedSystem).entityRefFor(typeKey, "ping-1")
|
||||
entityRef1 ! Ping(1, pongProbe.ref)
|
||||
pongProbe.receiveMessage()
|
||||
val entityRef1 = ClusterSharding(typedSystem).entityRefFor(typeKey, "ping-1")
|
||||
entityRef1 ! Ping(1, pongProbe.ref)
|
||||
pongProbe.receiveMessage()
|
||||
|
||||
val entityRef2 = ClusterSharding(typedSystem).entityRefFor(typeKey, "ping-2")
|
||||
entityRef2 ! Ping(2, pongProbe.ref)
|
||||
pongProbe.receiveMessage()
|
||||
}
|
||||
val entityRef2 = ClusterSharding(typedSystem).entityRefFor(typeKey, "ping-2")
|
||||
entityRef2 ! Ping(2, pongProbe.ref)
|
||||
pongProbe.receiveMessage()
|
||||
enterBarrier("sharding-initialized")
|
||||
|
||||
runOn(first, second, third) {
|
||||
val replyToProbe = TestProbe[ClusterShardingStats]()
|
||||
sharding.shardState ! GetClusterShardingStats(typeKey, queryTimeout, replyToProbe.ref)
|
||||
val statsProbe = TestProbe[ClusterShardingStats]()
|
||||
sharding.shardState ! GetClusterShardingStats(typeKey, queryTimeout, statsProbe.ref)
|
||||
|
||||
val stats = statsProbe.receiveMessage(queryTimeout)
|
||||
stats.regions.size shouldEqual 3 // 3 nodes
|
||||
stats.regions.values.flatMap(_.stats.values).sum shouldEqual 2 // number of entities
|
||||
stats.regions.values.forall(_.failed.isEmpty) shouldBe true
|
||||
|
||||
val stats = replyToProbe.receiveMessage(queryTimeout)
|
||||
stats.regions.size shouldEqual 3
|
||||
stats.regions.values.flatMap(_.stats.values).sum shouldEqual 2
|
||||
stats.regions.values.forall(_.failed.isEmpty) shouldBe true
|
||||
}
|
||||
enterBarrier("done")
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue