mirror of
https://github.com/vale981/ray
synced 2025-03-06 10:31:39 -05:00
Fix test_dying_worker_get (#5908)
This commit is contained in:
parent
0f24509c30
commit
2cbc67f3d5
1 changed files with 2 additions and 1 deletions
|
@ -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())
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue