mirror of
https://github.com/apache/superset.git
synced 2026-04-20 08:34:37 +00:00
fix: Use Celery task ETA for alert/report schedule (#24537)
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user