From d645873fe15d851f90a170413cb153b0862f1043 Mon Sep 17 00:00:00 2001 From: Philipp Moritz Date: Mon, 5 Jun 2023 22:37:58 -0700 Subject: [PATCH 1/2] Deflake fork tests --- python/ray/tests/test_basic_4.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/python/ray/tests/test_basic_4.py b/python/ray/tests/test_basic_4.py index 3918239b840f..40e52b74d009 100644 --- a/python/ray/tests/test_basic_4.py +++ b/python/ray/tests/test_basic_4.py @@ -122,8 +122,12 @@ def g(): @pytest.mark.skipif( - sys.platform == "win32", - reason="Fork is only supported on *nix systems.", + sys.platform != "linux" + # Even though fork is supported on macOS, in practice + # it has many problems, see + # https://github.com/python/cpython/issues/84559 + # In truth, fork should probably not be used on any platform. + reason="Fork only works on linux.", ) def test_fork_support(shutdown_only): """Test that fork support works.""" From 0ebb5ff7e98fdc2c1ebcd3eab276163bba8f7f4b Mon Sep 17 00:00:00 2001 From: Philipp Moritz Date: Mon, 5 Jun 2023 22:39:40 -0700 Subject: [PATCH 2/2] update --- python/ray/tests/test_basic_4.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/ray/tests/test_basic_4.py b/python/ray/tests/test_basic_4.py index 40e52b74d009..90702dfa5917 100644 --- a/python/ray/tests/test_basic_4.py +++ b/python/ray/tests/test_basic_4.py @@ -122,11 +122,13 @@ def g(): @pytest.mark.skipif( - sys.platform != "linux" + sys.platform != "linux", # Even though fork is supported on macOS, in practice # it has many problems, see # https://github.com/python/cpython/issues/84559 - # In truth, fork should probably not be used on any platform. + # In truth, fork without exec should probably + # not even be used on linux. This pattern just has + # too many problems. reason="Fork only works on linux.", ) def test_fork_support(shutdown_only):