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

Adds teardown to avoid flaky tests with run_dialog #9149

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions tests/ert/unit_tests/gui/simulation/test_run_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ def notifier():
def run_dialog(qtbot: QtBot, run_model, event_queue, notifier):
run_dialog = RunDialog("mock.ert", run_model, event_queue, notifier)
qtbot.addWidget(run_dialog)
return run_dialog

# Teardown
yield run_dialog
run_dialog.close()


def test_terminating_experiment_shows_a_confirmation_dialog(
Expand Down Expand Up @@ -102,7 +105,6 @@ def test_run_dialog_polls_run_model_for_runtime(
)
event_queue.put(EndEvent(failed=False, msg=""))
qtbot.waitUntil(lambda: run_dialog.is_simulation_done() == True)
run_dialog.close()


def test_large_snapshot(
Expand Down Expand Up @@ -590,7 +592,6 @@ def handle_error_dialog(run_dialog):

QTimer.singleShot(100, lambda: handle_error_dialog(run_dialog))
qtbot.waitUntil(lambda: run_dialog.is_simulation_done() == True, timeout=100000)
run_dialog.close()


@pytest.mark.integration_test
Expand Down