From 83378a861038ac344f7974e5a363b40c959342d7 Mon Sep 17 00:00:00 2001 From: Edward Oakes Date: Fri, 8 Nov 2019 12:11:15 -0800 Subject: [PATCH] Improve flaky test_warning_monitor_died (#6113) --- python/ray/tests/test_failure.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/python/ray/tests/test_failure.py b/python/ray/tests/test_failure.py index c2a4ee7f6..804281e95 100644 --- a/python/ray/tests/test_failure.py +++ b/python/ray/tests/test_failure.py @@ -490,13 +490,17 @@ def test_version_mismatch(shutdown_only): ray.__version__ = ray_version -def test_warning_monitor_died(shutdown_only): - ray.init(num_cpus=0) +def test_warning_monitor_died(ray_start_2_cpus): + @ray.remote + def f(): + pass - time.sleep(1) # Make sure the monitor has started. + # Wait for the monitor process to start. + ray.get(f.remote()) + time.sleep(1) # Cause the monitor to raise an exception by pushing a malformed message to - # Redis. This will probably kill the raylets and the raylet_monitor in + # Redis. This will probably kill the raylet and the raylet_monitor in # addition to the monitor. fake_id = 20 * b"\x00" malformed_message = "asdf"