Tests for cluster router [R] - Where R = [Direct, RoundRobin, Random]
Start with with finishing off the already started tests for RoundRobin.
Put all the tests in src/test/akka/cluster/routing/* with one directory per test case.
Only test stateless actors.
1. Configure up test actor in the *.conf file as clustered actor:
In 'replicas' element: test 1-3 replicas as well as "auto" (meaning autoscaling).
See the akka-reference.conf for doc on the config file.
2. Make sure that the actor is automatically deployed and instantiated on all the nodes
3. Make sure router works as expected by sending messages to the actor (ClusterActorRef), receive replies containing info about the node it was replied on:
https://github.com/jboner/akka/blob/master/akka-cluster/src/test/scala/akka/cluster/routing/roundrobin_2_replicas/RoundRobin2ReplicasMultiJvmSpec.scala#L26
https://github.com/jboner/akka/blob/master/akka-cluster/src/test/scala/akka/cluster/routing/roundrobin_2_replicas/RoundRobin2ReplicasMultiJvmSpec.scala#L105
4. Shut down one of the nodes with a replica: node.shutdown() and let the fail-over of the failing actor happen. In order for fail-over to work you need more nodes running than the configured replica count in the config.
5. Test that the ClusterActorRef reference still works. Now utilizing the new node instead of the failing node.
6. Anything else you can think of we should add here?
Comments:
Put all the tests in src/test/akka/cluster/routing/* with one directory per test case.
Only test stateless actors.
1. Configure up test actor in the *.conf file as clustered actor:
akka.actor.deployment.service-hello.router = "round-robin" akka.actor.deployment.service-hello.clustered.replicas = 1
In 'replicas' element: test 1-3 replicas as well as "auto" (meaning autoscaling).
See the akka-reference.conf for doc on the config file.
2. Make sure that the actor is automatically deployed and instantiated on all the nodes
3. Make sure router works as expected by sending messages to the actor (ClusterActorRef), receive replies containing info about the node it was replied on:
https://github.com/jboner/akka/blob/master/akka-cluster/src/test/scala/akka/cluster/routing/roundrobin_2_replicas/RoundRobin2ReplicasMultiJvmSpec.scala#L26
https://github.com/jboner/akka/blob/master/akka-cluster/src/test/scala/akka/cluster/routing/roundrobin_2_replicas/RoundRobin2ReplicasMultiJvmSpec.scala#L105
4. Shut down one of the nodes with a replica: node.shutdown() and let the fail-over of the failing actor happen. In order for fail-over to work you need more nodes running than the configured replica count in the config.
5. Test that the ClusterActorRef reference still works. Now utilizing the new node instead of the failing node.
6. Anything else you can think of we should add here?
Comments:
- Direct router is point to point. Should not fail over but if replica node crashes then it should yield an error in the actor ref. (don't think this is impl. but write test for it).
- Random is hard to test. Let's try to think it through. Thoughts?
- FYI: The underlying method that the deployer is invoking is Cluster.store(actorRef, replicationFactor, serializer). This one stores the actor in ZK and also sends out internal message to all nodes to "check out" actor and instantiate it locally as remotely available actor (LocalActorRef) on the replica nodes.
Leave a comment
on 2011-07-06 10:02 *
By Jonas Bonér
Summary changed from Tests for cluster router [R] - Where R = [Direct, RoundRobin, Random, ConsistentHashing] to Tests for cluster router [R] - Where R = [Direct, RoundRobin, Random]
on 2011-08-02 07:13 *
By pveentjer
Assigned to changed from pveentjer to viktorklang
Status changed from Accepted to Test
Reviewed :-)
Good
H viktor,
is this task completed?
is this task completed?
I've reviewed the code, so if it does what it's supposed to it's done.
Updating tickets (#818, #821, #823, #836, #842, #854, #856, #865, #866, #867, #868, #869, #871, #872, #873, #877, #878, #879, #885, #888, #889, #890, #894, #910, #911, #917, #923, #924, #925, #926, #927, #928, #930, #931, #932, #933, #934, #936, #937, #952, #955, #957, #958, #959, #960, #961, #964, #965, #966)