From db7029b87fbe592942a5d498258eed175f26ac95 Mon Sep 17 00:00:00 2001 From: Daniel Vaz Gaspar Date: Mon, 26 Apr 2021 18:56:48 +0100 Subject: [PATCH] fix: flaky test for alerts and reports (#14347) --- tests/reports/commands_tests.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/reports/commands_tests.py b/tests/reports/commands_tests.py index bc0bf792a7b2d..d1e57d2abff61 100644 --- a/tests/reports/commands_tests.py +++ b/tests/reports/commands_tests.py @@ -107,13 +107,9 @@ def get_notification_error_sent_count(report_schedule: ReportSchedule) -> int: def assert_log(state: str, error_message: Optional[str] = None): db.session.commit() logs = db.session.query(ReportExecutionLog).all() - if state == ReportState.WORKING: - assert len(logs) == 2 - assert logs[1].error_message == error_message - assert logs[1].state == state - return - # On error we send an email + if state == ReportState.ERROR: + # On error we send an email assert len(logs) == 3 else: assert len(logs) == 2