From 56f69543d0a305ef6f1a5dc72ae4843e15e2afed Mon Sep 17 00:00:00 2001 From: SangBin Cho Date: Mon, 12 Oct 2020 10:03:36 -0700 Subject: [PATCH] Try to deflake test_failure (#11293) --- python/ray/tests/test_failure.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/python/ray/tests/test_failure.py b/python/ray/tests/test_failure.py index b91d836dd..ff4c3a810 100644 --- a/python/ray/tests/test_failure.py +++ b/python/ray/tests/test_failure.py @@ -459,9 +459,18 @@ def test_actor_scope_or_intentionally_killed_message(ray_start_regular, @ray.remote class Actor: - pass + def __init__(self): + # This log is added to debug a flaky test issue. + print(os.getpid()) + + def ping(self): + pass a = Actor.remote() + # Without this waiting, there seems to be race condition happening + # in the CI. This is not a fundamental fix for that, but it at least + # makes the test less flaky. + ray.get(a.ping.remote()) a = Actor.remote() a.__ray_terminate__.remote() time.sleep(1)