fix: Use Celery task ETA for alert/report schedule (#24537)

This commit is contained in:
John Bodley
2023-06-28 10:53:13 -07:00
committed by GitHub
parent 0986423d30
commit e402c94a9f
2 changed files with 6 additions and 13 deletions

View File

@@ -171,7 +171,7 @@ def test_execute_task(update_state_mock, command_mock, init_mock, owners):
init_mock.return_value = None
command_mock.side_effect = ReportScheduleUnexpectedError("Unexpected error")
with freeze_time("2020-01-01T09:00:00Z"):
execute(report_schedule.id, "2020-01-01T09:00:00Z")
execute(report_schedule.id)
update_state_mock.assert_called_with(state="FAILURE")
db.session.delete(report_schedule)
@@ -199,7 +199,7 @@ def test_execute_task_with_command_exception(
init_mock.return_value = None
command_mock.side_effect = CommandException("Unexpected error")
with freeze_time("2020-01-01T09:00:00Z"):
execute(report_schedule.id, "2020-01-01T09:00:00Z")
execute(report_schedule.id)
update_state_mock.assert_called_with(state="FAILURE")
logger_mock.exception.assert_called_with(
"A downstream exception occurred while generating a report: None. Unexpected error",