From 2cbc67f3d558babc4b6f482e78c0608780189b05 Mon Sep 17 00:00:00 2001 From: Eric Liang Date: Sun, 13 Oct 2019 18:06:28 -0700 Subject: [PATCH] Fix test_dying_worker_get (#5908) --- python/ray/tests/test_component_failures.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/ray/tests/test_component_failures.py b/python/ray/tests/test_component_failures.py index a96df1805..b7e5e0a62 100644 --- a/python/ray/tests/test_component_failures.py +++ b/python/ray/tests/test_component_failures.py @@ -26,6 +26,7 @@ from ray.tests.utils import (run_string_as_driver_nonblocking, def test_dying_worker_get(ray_start_2_cpus): @ray.remote def sleep_forever(): + ray.experimental.signal.send("ready") time.sleep(10**6) @ray.remote @@ -33,7 +34,7 @@ def test_dying_worker_get(ray_start_2_cpus): return os.getpid() x_id = sleep_forever.remote() - time.sleep(0.01) # Try to wait for the sleep task to get scheduled. + ray.experimental.signal.receive([x_id]) # Block until it is scheduled. # Get the PID of the other worker. worker_pid = ray.get(get_worker_pid.remote())