From c0823f6a68888e57a0fac7fdc58fc0b927ba61d2 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Mon, 18 Mar 2024 07:45:44 +0000 Subject: [PATCH 1/2] Increase timeouts --- .../pytests/functional/modules/state/requisites/test_unless.py | 1 + tests/pytests/functional/states/test_docker_container.py | 2 +- tests/pytests/integration/states/test_beacon.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/pytests/functional/modules/state/requisites/test_unless.py b/tests/pytests/functional/modules/state/requisites/test_unless.py index 237163da40c..b4b19670ceb 100644 --- a/tests/pytests/functional/modules/state/requisites/test_unless.py +++ b/tests/pytests/functional/modules/state/requisites/test_unless.py @@ -3,6 +3,7 @@ import pytest pytestmark = [ pytest.mark.windows_whitelisted, pytest.mark.core_test, + pytest.mark.timeout_unless_on_windows(240), ] diff --git a/tests/pytests/functional/states/test_docker_container.py b/tests/pytests/functional/states/test_docker_container.py index d5932cf6ad5..2cfc5b7a343 100644 --- a/tests/pytests/functional/states/test_docker_container.py +++ b/tests/pytests/functional/states/test_docker_container.py @@ -29,7 +29,7 @@ pytestmark = [ pytest.mark.skip_if_binaries_missing( "docker", "dockerd", reason="Docker not installed" ), - pytest.mark.timeout_unless_on_windows(120), + pytest.mark.timeout_unless_on_windows(240), ] IPV6_ENABLED = bool(salt.utils.network.ip_addrs6(include_loopback=True)) diff --git a/tests/pytests/integration/states/test_beacon.py b/tests/pytests/integration/states/test_beacon.py index 5aefa6ecf2b..1b0db5d65fe 100644 --- a/tests/pytests/integration/states/test_beacon.py +++ b/tests/pytests/integration/states/test_beacon.py @@ -26,6 +26,7 @@ def test_present_absent(salt_master, salt_minion, salt_call_cli): ret = salt_call_cli.run( "state.apply", "manage_beacons", + _timeout=120, ) assert ret.returncode == 0 state_id = "beacon_|-beacon-diskusage_|-diskusage_|-present" From e50d3a194fbe5562c7e39ba5eb9dd5d044c8ed56 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Mon, 18 Mar 2024 08:46:37 +0000 Subject: [PATCH 2/2] Skip problematic MacOS test in specific conditions --- .../functional/modules/test_mac_assistive.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/pytests/functional/modules/test_mac_assistive.py b/tests/pytests/functional/modules/test_mac_assistive.py index d2b6808b56d..d7ea4518023 100644 --- a/tests/pytests/functional/modules/test_mac_assistive.py +++ b/tests/pytests/functional/modules/test_mac_assistive.py @@ -22,7 +22,7 @@ def assistive(modules): def osa_script(assistive): osa_script_path = "/usr/bin/osascript" try: - ret = assistive.install(osa_script_path, True) + assistive.install(osa_script_path, True) yield osa_script_path except CommandExecutionError as exc: pytest.skip(f"Unable to install {osa_script}: {exc}") @@ -33,7 +33,7 @@ def osa_script(assistive): @pytest.fixture -def install_remove_pkg_name(assistive): +def install_remove_pkg_name(assistive, grains): smile_bundle = "com.smileonmymac.textexpander" try: yield smile_bundle @@ -44,12 +44,19 @@ def install_remove_pkg_name(assistive): @pytest.mark.slow_test -def test_install_and_remove(assistive, install_remove_pkg_name): +def test_install_and_remove(assistive, install_remove_pkg_name, grains): """ Tests installing and removing a bundled ID or command to use assistive access. """ - ret = assistive.install(install_remove_pkg_name) - assert ret + try: + ret = assistive.install(install_remove_pkg_name) + assert ret + except CommandExecutionError as exc: + if grains["osmajorrelease"] != 12: + raise exc from None + if "attempt to write a readonly database" not in str(exc): + raise exc from None + pytest.skip("Test fails on MacOS 12(attempt to write a readonly database)") ret = assistive.remove(install_remove_pkg_name) assert ret