Reset signal counters when a task finishes (#4173)

This commit is contained in:
Ion
2019-02-28 15:15:03 -08:00
committed by Philipp Moritz
parent 4dc683d39e
commit 88e14feb53
3 changed files with 24 additions and 1 deletions
+19
View File
@@ -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