Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip tests on macos because multiprocess default switch to spawn since Python 3.8 #3705

Merged
merged 12 commits into from
Mar 13, 2024
21 changes: 12 additions & 9 deletions tests/framework/session/test_session_extension_hooks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging
import multiprocessing
import re
import sys
import time
from typing import Any

Expand Down Expand Up @@ -30,8 +30,11 @@
assert_exceptions_equal,
)

SKIP_ON_WINDOWS = pytest.mark.skipif(
sys.platform.startswith("win"), reason="Due to bug in parallel runner"
# Window and MacOS(Python>3.7) default with `spawn` process which reload modules
# and cause test fails
SKIP_ON_WINDOWS_AND_MACOS = pytest.mark.skipif(
multiprocessing.get_start_method() == "spawn",
reason="Due to bug in parallel runner",
)

logger = logging.getLogger("tests.framework.session.conftest")
Expand Down Expand Up @@ -233,7 +236,7 @@ def test_before_and_after_node_run_hooks_sequential_runner(
# sanity check a couple of important parameters
assert call_record.outputs["planes"].to_dict() == dummy_dataframe.to_dict()

@SKIP_ON_WINDOWS
@SKIP_ON_WINDOWS_AND_MACOS
@pytest.mark.usefixtures("mock_broken_pipelines")
def test_on_node_error_hook_parallel_runner(self, mock_session, logs_listener):
with pytest.raises(ValueError, match="broken"):
Expand All @@ -254,7 +257,7 @@ def test_on_node_error_hook_parallel_runner(self, mock_session, logs_listener):
expected_error = ValueError("broken")
assert_exceptions_equal(call_record.error, expected_error)

@SKIP_ON_WINDOWS
@SKIP_ON_WINDOWS_AND_MACOS
@pytest.mark.usefixtures("mock_pipelines")
def test_before_and_after_node_run_hooks_parallel_runner(
self, mock_session, logs_listener, dummy_dataframe
Expand Down Expand Up @@ -322,7 +325,7 @@ def test_before_and_after_dataset_loaded_hooks_sequential_runner(
assert call_record.dataset_name == "cars"
pd.testing.assert_frame_equal(call_record.data, dummy_dataframe)

@SKIP_ON_WINDOWS
@SKIP_ON_WINDOWS_AND_MACOS
@pytest.mark.usefixtures("mock_settings")
def test_before_and_after_dataset_loaded_hooks_parallel_runner(
self, mock_session, logs_listener, dummy_dataframe
Expand Down Expand Up @@ -388,7 +391,7 @@ def test_before_and_after_dataset_saved_hooks_sequential_runner(
assert call_record.dataset_name == "planes"
assert call_record.data.to_dict() == dummy_dataframe.to_dict()

@SKIP_ON_WINDOWS
@SKIP_ON_WINDOWS_AND_MACOS
def test_before_and_after_dataset_saved_hooks_parallel_runner(
self, mock_session, logs_listener, dummy_dataframe
):
Expand Down Expand Up @@ -475,7 +478,7 @@ def test_correct_input_update(
assert isinstance(result["planes"], MockDatasetReplacement)
assert isinstance(result["ships"], pd.DataFrame)

@SKIP_ON_WINDOWS
@SKIP_ON_WINDOWS_AND_MACOS
def test_correct_input_update_parallel(
self,
mock_session_with_before_node_run_hooks,
Expand Down Expand Up @@ -505,7 +508,7 @@ def test_broken_input_update(
with pytest.raises(TypeError, match=re.escape(pattern)):
mock_session_with_broken_before_node_run_hooks.run()

@SKIP_ON_WINDOWS
@SKIP_ON_WINDOWS_AND_MACOS
def test_broken_input_update_parallel(
self, mock_session_with_broken_before_node_run_hooks, dummy_dataframe
):
Expand Down