Skip to content

Commit

Permalink
Stop all locally running nodes (#883)
Browse files Browse the repository at this point in the history
When starting multiple nodes on one machine, Rally only stopped the
first node. With this commit we actually stop all nodes.
  • Loading branch information
danielmitterdorfer authored Feb 3, 2020
1 parent 949107e commit 39e9015
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion esrally/mechanic/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,4 +257,4 @@ def stop(self, nodes, metrics_store):
# store system metrics in any case (telemetry devices may derive system metrics while the node is running)
if metrics_store:
node.telemetry.store_system_metrics(node, metrics_store)
return stopped_nodes
return stopped_nodes
14 changes: 8 additions & 6 deletions tests/mechanic/launcher_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,14 @@ def test_daemon_start_stop(self, wait_for_pidfile, chdir, get_size, supports, ja
ms = get_metrics_store(cfg)
proc_launcher = launcher.ProcessLauncher(cfg)

node_config = NodeConfiguration(build_type="tar", car_env={}, car_runtime_jdks="12,11", ip="127.0.0.1",
node_name="testnode", node_root_path="/tmp", binary_path="/tmp",
data_paths="/tmp")

nodes = proc_launcher.start([node_config])
self.assertEqual(len(nodes), 1)
node_configs = []
for node in range(2):
node_configs.append(NodeConfiguration(build_type="tar", car_env={}, car_runtime_jdks="12,11",
ip="127.0.0.1", node_name="testnode-{}".format(node),
node_root_path="/tmp", binary_path="/tmp", data_paths="/tmp"))

nodes = proc_launcher.start(node_configs)
self.assertEqual(len(nodes), 2)
self.assertEqual(nodes[0].pid, MOCK_PID_VALUE)

stopped_nodes = proc_launcher.stop(nodes, ms)
Expand Down

0 comments on commit 39e9015

Please sign in to comment.