message: fix: flaky test for alerts and reports
diff: @@ -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
  