From 4033d65e4ff0383cf9d3902643ed1d81018ea733 Mon Sep 17 00:00:00 2001 From: Simon Mo Date: Fri, 29 Nov 2019 22:50:05 -0800 Subject: [PATCH] Fix redis-server stoping in linux (#6296) * Cleanup test_calling_start_ray_head * Kill redis-server with args instead of comm In linux, ps -o pid,comm output just redis-server instead of the full executable path --- python/ray/scripts/scripts.py | 2 +- python/ray/tests/conftest.py | 5 +++++ python/ray/tests/test_multi_node.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/python/ray/scripts/scripts.py b/python/ray/scripts/scripts.py index 733e868ec..e2ef2a167 100644 --- a/python/ray/scripts/scripts.py +++ b/python/ray/scripts/scripts.py @@ -444,7 +444,7 @@ def stop(force, verbose): ["plasma_store", True], ["raylet_monitor", True], ["monitor.py", False], - ["redis-server", True], + ["redis-server", False], ["default_worker.py", False], # Python worker. ["ray::", True], # Python worker. ["org.ray.runtime.runner.worker.DefaultWorker", False], # Java worker. diff --git a/python/ray/tests/conftest.py b/python/ray/tests/conftest.py index 1476b8642..e6b05f9ea 100644 --- a/python/ray/tests/conftest.py +++ b/python/ray/tests/conftest.py @@ -162,6 +162,11 @@ def call_ray_start(request): # Kill the Ray cluster. subprocess.check_output(["ray", "stop"]) +@pytest.fixture +def call_ray_stop_only(): + yield + subprocess.check_output(["ray", "stop"]) + @pytest.fixture() def two_node_cluster(): diff --git a/python/ray/tests/test_multi_node.py b/python/ray/tests/test_multi_node.py index aa03d37ff..4284abb07 100644 --- a/python/ray/tests/test_multi_node.py +++ b/python/ray/tests/test_multi_node.py @@ -321,7 +321,7 @@ print("success") process_handle.kill() -def test_calling_start_ray_head(): +def test_calling_start_ray_head(call_ray_stop_only): # Test that we can call ray start with various command line # parameters. TODO(rkn): This test only tests the --head code path. We # should also test the non-head node code path.