Skip to content

Flaky test_that_experiment_with_a_scheduler_warning_event_shows_a_warning_dialog #13475

@xjules

Description

@xjules

I've seen this test fail on PRs:

test_that_experiment_with_a_scheduler_warning_event_shows_a_warning_dialog[scheduler_warning_event_between_snapshot_events]>

    @pytest.hookimpl(wrapper=True, trylast=True)
    def pytest_runtest_teardown(item):
        """
        Hook called after each test tear down, to process any pending events and
        avoiding leaking events to the next test. Also, if exceptions have
        been captured during fixtures teardown, fail the test.
        """
        _process_events()
        _close_widgets(item)
        _process_events()
>       result = yield
                 ^^^^^

/home/runner/work/ert/ert/.venv/lib/python3.11/site-packages/pytestqt/plugin.py:205: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    @pytest.fixture(autouse=True)
    def env_save():
        exceptions = [
            "PYTEST_CURRENT_TEST",
            "KMP_DUPLICATE_LIB_OK",
            "KMP_INIT_AT_FORK",
            "QT_API",
            "COV_CORE_CONTEXT",
        ]
        environment_pre = [
            (key, val) for key, val in os.environ.items() if key not in exceptions
        ]
        yield
        environment_post = [
            (key, val) for key, val in os.environ.items() if key not in exceptions
        ]
        set_xor = set(environment_pre).symmetric_difference(set(environment_post))
>       assert len(set_xor) == 0, f"Detected differences in environment: {set_xor}"
E       AssertionError: Detected differences in environment: {('_ERT_EXPERIMENT_ID', 'c07ae22e-f317-4281-8703-9d00b9d1ec9e'), ('_ERT_ENSEMBLE_ID', '03c3a4c2-d51a-4b94-8758-87feb989b490')}

https://github.com/equinor/ert/actions/runs/25323198550/job/74237477180?pr=13416

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions