Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop all locally running nodes #883

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion esrally/mechanic/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,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
10 changes: 5 additions & 5 deletions tests/mechanic/launcher_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ 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")
node_configs = [NodeConfiguration(build_type="tar", car_env={}, car_runtime_jdks="12,11", ip="127.0.0.1",
node_name="testnode-{}".format(n), node_root_path="/tmp", binary_path="/tmp",
data_paths="/tmp") for n in range(2)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would improve readability if we used a regular for-loop here instead of a list comprehension.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I changed it in 51c0df6.


nodes = proc_launcher.start([node_config])
self.assertEqual(len(nodes), 1)
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