mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 11:53:32 +08:00
Fix test_dying_worker_get (#5908)
This commit is contained in:
@@ -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())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user