diff --git a/akka-docs/rst/dev/multi-node-testing.rst b/akka-docs/rst/dev/multi-node-testing.rst index 234c256876..eca5139a9a 100644 --- a/akka-docs/rst/dev/multi-node-testing.rst +++ b/akka-docs/rst/dev/multi-node-testing.rst @@ -36,14 +36,16 @@ This is a schematic overview of the test conductor. .. image:: ../images/akka-remote-testconductor.png The test conductor server is responsible for coordinating barriers and sending commands to the test conductor -clients that act upon them, e.g. throttling network traffic to/from another client. +clients that act upon them, e.g. throttling network traffic to/from another client. More information on the +possible operations is availible in the ``akka.remote.testconductor.Conductor`` API documentation. The Multi Node Spec =================== The Multi Node Spec consists of two parts. The ``MultiNodeConfig`` that is responsible for common -configuration and enumerating and naming the nodes under test. The ``MultiNodeSpec`` that contains all the -convenience functions for making the test nodes interact with each other. +configuration and enumerating and naming the nodes under test. The ``MultiNodeSpec`` that contains a number +of convenience functions for making the test nodes interact with each other. More information on the possible +operations is available in the ``akka.remote.testkit.MultiNodeSpec`` API documentation. The setup of the ``MultiNodeSpec`` is configured through java system properties that you set on all JVMs that's going to run a node under test. These can easily be set on the JVM command line with ``-Dproperty=value``. diff --git a/akka-remote-tests/src/main/scala/akka/remote/testconductor/Conductor.scala b/akka-remote-tests/src/main/scala/akka/remote/testconductor/Conductor.scala index 84b2f17173..b58ebb7506 100644 --- a/akka-remote-tests/src/main/scala/akka/remote/testconductor/Conductor.scala +++ b/akka-remote-tests/src/main/scala/akka/remote/testconductor/Conductor.scala @@ -191,17 +191,6 @@ trait Conductor { this: TestConductorExt ⇒ controller ? Terminate(node, exitValue) mapTo classTag[Done] } - /** - * Tell the SBT plugin to forcibly terminate the given remote node using Process.destroy. - * - * @param node is the symbolic name of the node which is to be affected - */ - // TODO: uncomment (and implement in Controller) if really needed - // def kill(node: RoleName): Future[Done] = { - // import Settings.QueryTimeout - // controller ? Terminate(node, -1) mapTo classTag[Done] - // } - /** * Obtain the list of remote host names currently registered. */ @@ -455,12 +444,8 @@ private[akka] class Controller(private var initialParticipants: Int, controllerP val t = nodes(target) nodes(node).fsm forward ToClient(DisconnectMsg(t.addr, abort)) case Terminate(node, exitValueOrKill) ⇒ - if (exitValueOrKill < 0) { - // TODO: kill via SBT - } else { - barrier ! BarrierCoordinator.RemoveClient(node) - nodes(node).fsm forward ToClient(TerminateMsg(exitValueOrKill)) - } + barrier ! BarrierCoordinator.RemoveClient(node) + nodes(node).fsm forward ToClient(TerminateMsg(exitValueOrKill)) case Remove(node) ⇒ barrier ! BarrierCoordinator.RemoveClient(node) } diff --git a/akka-remote-tests/src/main/scala/akka/remote/testkit/MultiNodeSpec.scala b/akka-remote-tests/src/main/scala/akka/remote/testkit/MultiNodeSpec.scala index c2622e0401..a842a547a1 100644 --- a/akka-remote-tests/src/main/scala/akka/remote/testkit/MultiNodeSpec.scala +++ b/akka-remote-tests/src/main/scala/akka/remote/testkit/MultiNodeSpec.scala @@ -312,6 +312,10 @@ abstract class MultiNodeSpec(val myself: RoleName, _system: ActorSystem, _roles: } } + /** + * Execute the `yes` block of code only on the given nodes (names according + * to the `roleMap`) else execute the `no` block of code. + */ def ifNode[T](nodes: RoleName*)(yes: ⇒ T)(no: ⇒ T): T = { if (nodes exists (_ == myself)) yes else no }