From 8f0df91da28e256385c4301d602b58725ebdc985 Mon Sep 17 00:00:00 2001 From: beckermr Date: Sun, 16 Feb 2025 06:47:52 -0600 Subject: [PATCH 1/7] test: use flaky decorator for flaky tests --- news/55ZZ-flaky-tests.rst | 3 +++ tests/requirements-ci.txt | 1 + tests/test_api_build.py | 3 +++ 3 files changed, 7 insertions(+) create mode 100644 news/55ZZ-flaky-tests.rst diff --git a/news/55ZZ-flaky-tests.rst b/news/55ZZ-flaky-tests.rst new file mode 100644 index 0000000000..55055d6cb8 --- /dev/null +++ b/news/55ZZ-flaky-tests.rst @@ -0,0 +1,3 @@ +### Other + +* Introduced the ``flaky`` decorator for tests that fail at random. (#55ZZ) diff --git a/tests/requirements-ci.txt b/tests/requirements-ci.txt index bb41f87fd7..c1afcf5b94 100644 --- a/tests/requirements-ci.txt +++ b/tests/requirements-ci.txt @@ -3,6 +3,7 @@ conda-verify contextlib2 coverage cytoolz +flaky git numpy perl diff --git a/tests/test_api_build.py b/tests/test_api_build.py index 6b688f8e6a..97d781b869 100644 --- a/tests/test_api_build.py +++ b/tests/test_api_build.py @@ -34,6 +34,7 @@ from conda.exceptions import ClobberError, CondaError, CondaMultiError, LinkError from conda.utils import url_path from conda_index.api import update_index +from flaky import flaky from packaging.version import Version from conda_build import __version__, api, exceptions @@ -474,6 +475,7 @@ def test_build_msvc_compiler(msvc_ver, monkeypatch): @pytest.mark.sanity @pytest.mark.parametrize("platform", platforms) @pytest.mark.parametrize("target_compiler", compilers) +@flaky def test_cmake_generator(platform, target_compiler, testing_config): testing_config.variant["python"] = target_compiler testing_config.activate = True @@ -1791,6 +1793,7 @@ def test_overlinking_detection_ignore_patterns( rm_rf(dest_bat) +@flaky def test_overdepending_detection(testing_config, variants_conda_build_sysroot): testing_config.activate = True testing_config.error_overlinking = True From af5d940fed14db03be221eda176afdd0aab16814 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Sun, 16 Feb 2025 06:50:56 -0600 Subject: [PATCH 2/7] Fix typo in news file number for flaky tests --- news/{55ZZ-flaky-tests.rst => 5623-flaky-tests.rst} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename news/{55ZZ-flaky-tests.rst => 5623-flaky-tests.rst} (86%) diff --git a/news/55ZZ-flaky-tests.rst b/news/5623-flaky-tests.rst similarity index 86% rename from news/55ZZ-flaky-tests.rst rename to news/5623-flaky-tests.rst index 55055d6cb8..ad554e5926 100644 --- a/news/55ZZ-flaky-tests.rst +++ b/news/5623-flaky-tests.rst @@ -1,3 +1,3 @@ ### Other -* Introduced the ``flaky`` decorator for tests that fail at random. (#55ZZ) +* Introduced the ``flaky`` decorator for tests that fail at random. (#5623) \ No newline at end of file From cac015664037d9c6bc1a1f5b537c7b77280cac6e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 16 Feb 2025 12:51:29 +0000 Subject: [PATCH 3/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- news/5623-flaky-tests.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/5623-flaky-tests.rst b/news/5623-flaky-tests.rst index ad554e5926..9f0487e196 100644 --- a/news/5623-flaky-tests.rst +++ b/news/5623-flaky-tests.rst @@ -1,3 +1,3 @@ ### Other -* Introduced the ``flaky`` decorator for tests that fail at random. (#5623) \ No newline at end of file +* Introduced the ``flaky`` decorator for tests that fail at random. (#5623) From ff78ebb3e2e33614b964eab2c73c26fad81fd14d Mon Sep 17 00:00:00 2001 From: beckermr Date: Sun, 16 Feb 2025 06:56:22 -0600 Subject: [PATCH 4/7] fix: need older pytest --- tests/requirements-ci.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/requirements-ci.txt b/tests/requirements-ci.txt index c1afcf5b94..3db558ef0b 100644 --- a/tests/requirements-ci.txt +++ b/tests/requirements-ci.txt @@ -9,7 +9,7 @@ numpy perl pip pyflakes -pytest +pytest <8.1 pytest-cov pytest-forked pytest-mock From 1d05bc1258c12f605ff579e3d766f091c6cd0e84 Mon Sep 17 00:00:00 2001 From: beckermr Date: Sun, 16 Feb 2025 06:59:01 -0600 Subject: [PATCH 5/7] fix: use other package --- tests/requirements-ci.txt | 3 +-- tests/test_api_build.py | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/requirements-ci.txt b/tests/requirements-ci.txt index 3db558ef0b..bb41f87fd7 100644 --- a/tests/requirements-ci.txt +++ b/tests/requirements-ci.txt @@ -3,13 +3,12 @@ conda-verify contextlib2 coverage cytoolz -flaky git numpy perl pip pyflakes -pytest <8.1 +pytest pytest-cov pytest-forked pytest-mock diff --git a/tests/test_api_build.py b/tests/test_api_build.py index 97d781b869..850e80d006 100644 --- a/tests/test_api_build.py +++ b/tests/test_api_build.py @@ -34,7 +34,6 @@ from conda.exceptions import ClobberError, CondaError, CondaMultiError, LinkError from conda.utils import url_path from conda_index.api import update_index -from flaky import flaky from packaging.version import Version from conda_build import __version__, api, exceptions @@ -475,7 +474,7 @@ def test_build_msvc_compiler(msvc_ver, monkeypatch): @pytest.mark.sanity @pytest.mark.parametrize("platform", platforms) @pytest.mark.parametrize("target_compiler", compilers) -@flaky +@pytest.mark.flaky(reruns=5, reruns_delay=2) def test_cmake_generator(platform, target_compiler, testing_config): testing_config.variant["python"] = target_compiler testing_config.activate = True @@ -1793,7 +1792,7 @@ def test_overlinking_detection_ignore_patterns( rm_rf(dest_bat) -@flaky +@pytest.mark.flaky(reruns=5, reruns_delay=2) def test_overdepending_detection(testing_config, variants_conda_build_sysroot): testing_config.activate = True testing_config.error_overlinking = True From b08d58c190e47143d1ef3af9bb5139844ee9094d Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Sun, 16 Feb 2025 07:00:23 -0600 Subject: [PATCH 6/7] Update news/5623-flaky-tests.rst --- news/5623-flaky-tests.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/5623-flaky-tests.rst b/news/5623-flaky-tests.rst index 9f0487e196..45d7435f49 100644 --- a/news/5623-flaky-tests.rst +++ b/news/5623-flaky-tests.rst @@ -1,3 +1,3 @@ ### Other -* Introduced the ``flaky`` decorator for tests that fail at random. (#5623) +* Added the ``flaky`` mark for some OSX tests that fail at random. (#5623) From b1b50347f5545432ab2d7d009d3d371d9e63c8d3 Mon Sep 17 00:00:00 2001 From: beckermr Date: Sun, 16 Feb 2025 07:29:52 -0600 Subject: [PATCH 7/7] test: mark this one flaky too --- news/5623-flaky-tests.rst | 2 +- tests/test_api_build.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/news/5623-flaky-tests.rst b/news/5623-flaky-tests.rst index 45d7435f49..fe9ed4ee69 100644 --- a/news/5623-flaky-tests.rst +++ b/news/5623-flaky-tests.rst @@ -1,3 +1,3 @@ ### Other -* Added the ``flaky`` mark for some OSX tests that fail at random. (#5623) +* Added the ``flaky`` mark for some OSX/Win tests that fail at random. (#5623) diff --git a/tests/test_api_build.py b/tests/test_api_build.py index 850e80d006..935dcdf6d0 100644 --- a/tests/test_api_build.py +++ b/tests/test_api_build.py @@ -316,6 +316,7 @@ def test_output_build_path_git_source(testing_config): @pytest.mark.sanity @pytest.mark.serial +@pytest.mark.flaky(reruns=5, reruns_delay=2) def test_build_with_no_activate_does_not_activate(): api.build( os.path.join(metadata_dir, "_set_env_var_no_activate_build"),