mirror of
https://github.com/wassname/ray.git
synced 2026-07-03 20:39:52 +08:00
Reset signal counters when a task finishes (#4173)
This commit is contained in:
@@ -316,3 +316,22 @@ def test_receiving_on_two_returns(ray_start):
|
||||
|
||||
assert ((x == results[0][0] and y == results[1][0])
|
||||
or (x == results[1][0] and y == results[0][0]))
|
||||
|
||||
|
||||
def test_serial_tasks_reading_same_signal(ray_start):
|
||||
@ray.remote
|
||||
def send_signal(value):
|
||||
signal.send(UserSignal(value))
|
||||
|
||||
a = send_signal.remote(0)
|
||||
|
||||
@ray.remote
|
||||
def f(sources):
|
||||
return ray.experimental.signal.receive(sources, timeout=1)
|
||||
|
||||
result_list = ray.get(f.remote([a]))
|
||||
assert len(result_list) == 1
|
||||
result_list = ray.get(f.remote([a]))
|
||||
assert len(result_list) == 1
|
||||
result_list = ray.get(f.remote([a]))
|
||||
assert len(result_list) == 1
|
||||
|
||||
Reference in New Issue
Block a user