-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
17 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,7 +111,7 @@ def test_dag_file_processor_sla_miss_callback(self, create_dummy_dag): | |
|
||
# Create dag with a start of 1 day ago, but an sla of 0 | ||
# so we'll already have an sla_miss on the books. | ||
test_start_date = timezone.datetime(2022, 1, 1) | ||
test_start_date = timezone.utcnow() - datetime.timedelta(days=1) | ||
dag, task = create_dummy_dag( | ||
dag_id='test_sla_miss', | ||
task_id='dummy', | ||
|
@@ -140,7 +140,7 @@ def test_dag_file_processor_sla_miss_callback_invalid_sla(self, create_dummy_dag | |
# Create dag with a start of 1 day ago, but an sla of 0 | ||
# so we'll already have an sla_miss on the books. | ||
# Pass anything besides a timedelta object to the sla argument. | ||
test_start_date = timezone.datetime(2022, 1, 1) | ||
test_start_date = timezone.utcnow() - datetime.timedelta(days=1) | ||
dag, task = create_dummy_dag( | ||
dag_id='test_sla_miss', | ||
task_id='dummy', | ||
|
@@ -168,7 +168,7 @@ def test_dag_file_processor_sla_miss_callback_sent_notification(self, create_dum | |
|
||
# Create dag with a start of 2 days ago, but an sla of 1 day | ||
# ago so we'll already have an sla_miss on the books | ||
test_start_date = timezone.datetime(2022, 1, 1) | ||
test_start_date = timezone.utcnow() - datetime.timedelta(days=2) | ||
dag, task = create_dummy_dag( | ||
dag_id='test_sla_miss', | ||
task_id='dummy', | ||
|
@@ -204,7 +204,7 @@ def test_dag_file_processor_sla_miss_doesnot_raise_integrity_error(self, dag_mak | |
|
||
# Create dag with a start of 2 days ago, but an sla of 1 day | ||
# ago so we'll already have an sla_miss on the books | ||
test_start_date = timezone.datetime(2022, 1, 1) | ||
test_start_date = timezone.utcnow() - datetime.timedelta(days=2) | ||
with dag_maker( | ||
dag_id='test_sla_miss', | ||
default_args={'start_date': test_start_date, 'sla': datetime.timedelta(days=1)}, | ||
|
@@ -245,7 +245,7 @@ def test_dag_file_processor_sla_miss_callback_exception(self, mock_stats_incr, c | |
|
||
sla_callback = MagicMock(side_effect=RuntimeError('Could not call function')) | ||
|
||
test_start_date = timezone.datetime(2022, 1, 1) | ||
test_start_date = timezone.utcnow() - datetime.timedelta(days=1) | ||
dag, task = create_dummy_dag( | ||
dag_id='test_sla_miss', | ||
task_id='dummy', | ||
|
@@ -275,7 +275,7 @@ def test_dag_file_processor_only_collect_emails_from_sla_missed_tasks( | |
): | ||
session = settings.Session() | ||
|
||
test_start_date = timezone.datetime(2022, 1, 1) | ||
test_start_date = timezone.utcnow() - datetime.timedelta(days=1) | ||
email1 = '[email protected]' | ||
dag, task = create_dummy_dag( | ||
dag_id='test_sla_miss', | ||
|
@@ -315,7 +315,7 @@ def test_dag_file_processor_sla_miss_email_exception( | |
# Mock the callback function so we can verify that it was not called | ||
mock_send_email.side_effect = RuntimeError('Could not send an email') | ||
|
||
test_start_date = timezone.datetime(2022, 1, 1) | ||
test_start_date = timezone.utcnow() - datetime.timedelta(days=1) | ||
dag, task = create_dummy_dag( | ||
dag_id='test_sla_miss', | ||
task_id='dummy', | ||
|
@@ -345,7 +345,7 @@ def test_dag_file_processor_sla_miss_deleted_task(self, create_dummy_dag): | |
""" | ||
session = settings.Session() | ||
|
||
test_start_date = timezone.datetime(2022, 1, 1) | ||
test_start_date = timezone.utcnow() - datetime.timedelta(days=1) | ||
dag, task = create_dummy_dag( | ||
dag_id='test_sla_miss', | ||
task_id='dummy', | ||
|