From 5fbfda5ee43780ad61e758b8b834c9e8084b0cef Mon Sep 17 00:00:00 2001 From: "Yngve S. Kristiansen" Date: Mon, 4 Mar 2024 08:02:13 +0100 Subject: [PATCH] Try pytest-retry instead of flaky --- pyproject.toml | 4 ++-- .../integration_tests/storage/test_parameter_sample_types.py | 3 +-- tests/performance_tests/test_memory_usage.py | 3 +-- tests/unit_tests/scheduler/test_scheduler.py | 5 ++--- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8d4ad14f79f..691eadbbbc8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -94,7 +94,6 @@ Repository = "https://github.com/equinor/ert" dev = [ "decorator", "furo", - "flaky", "hypothesis", "jsonpath_ng", "jupytext", @@ -107,10 +106,11 @@ dev = [ "pytest-mpl", "pytest-qt", "pytest-raises", + "pytest-retry", "pytest-snapshot", "pytest-timeout", "pytest-xdist", - "pytest>6,<8.1.0", + "pytest>6", "resfo", "scikit-learn", "sphinx", diff --git a/tests/integration_tests/storage/test_parameter_sample_types.py b/tests/integration_tests/storage/test_parameter_sample_types.py index c3b95e65145..894748c13c9 100644 --- a/tests/integration_tests/storage/test_parameter_sample_types.py +++ b/tests/integration_tests/storage/test_parameter_sample_types.py @@ -7,7 +7,6 @@ import numpy as np import pytest import xtgeo -from flaky import flaky from ert.cli import ENSEMBLE_SMOOTHER_MODE from ert.libres_facade import LibresFacade @@ -179,7 +178,7 @@ def test_surface_param_update(tmpdir): @pytest.mark.integration_test @pytest.mark.limit_memory("110 MB") -@flaky(max_runs=5, min_passes=1) +@pytest.mark.flaky(retries=5) def test_field_param_memory(tmpdir): with tmpdir.as_cwd(): # Setup is done in a subprocess so that memray does not pick up the allocations diff --git a/tests/performance_tests/test_memory_usage.py b/tests/performance_tests/test_memory_usage.py index 0d01c678d22..81f16b273bd 100644 --- a/tests/performance_tests/test_memory_usage.py +++ b/tests/performance_tests/test_memory_usage.py @@ -7,7 +7,6 @@ import py import pytest import xarray as xr -from flaky import flaky from ert.analysis import smoother_update from ert.config import ErtConfig, SummaryConfig @@ -40,7 +39,7 @@ def poly_template(monkeypatch): yield folder -@flaky(max_runs=5, min_passes=1) +@pytest.mark.flaky(retries=5) @pytest.mark.limit_memory("130 MB") @pytest.mark.integration_test def test_memory_smoothing(poly_template): diff --git a/tests/unit_tests/scheduler/test_scheduler.py b/tests/unit_tests/scheduler/test_scheduler.py index be73695d8c0..90ca64fdc8f 100644 --- a/tests/unit_tests/scheduler/test_scheduler.py +++ b/tests/unit_tests/scheduler/test_scheduler.py @@ -8,7 +8,6 @@ import pytest from cloudevents.http import from_json -from flaky import flaky from ert.constant_filenames import CERT_FILE from ert.ensemble_evaluator._builder._realization import Realization @@ -381,7 +380,7 @@ async def wait(iens): assert killed_iens == [6, 7, 8, 9] -@flaky(max_runs=5, min_passes=1) +@pytest.mark.flaky(retries=5) @pytest.mark.parametrize( "submit_sleep, iens_stride, realization_runtime", [(0, 1, 0.1), (0.1, 1, 0.1), (0.1, 1, 0), (0.1, 2, 0)], @@ -424,7 +423,7 @@ async def wait(): assert max(deltas) <= submit_sleep + 0.1 -@flaky(max_runs=5, min_passes=1) +@pytest.mark.flaky(retries=5) @pytest.mark.parametrize( "submit_sleep, realization_max_runtime, max_running", [