mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-19 14:08:47 -04:00
add expire times for redis objects
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import json
|
import json
|
||||||
|
from unittest.mock import ANY
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from botocore.exceptions import ClientError
|
from botocore.exceptions import ClientError
|
||||||
@@ -148,7 +149,7 @@ def test_should_add_to_retry_queue_if_notification_not_found_in_deliver_sms_task
|
|||||||
deliver_sms(notification_id)
|
deliver_sms(notification_id)
|
||||||
app.delivery.send_to_providers.send_sms_to_provider.assert_not_called()
|
app.delivery.send_to_providers.send_sms_to_provider.assert_not_called()
|
||||||
app.celery.provider_tasks.deliver_sms.retry.assert_called_with(
|
app.celery.provider_tasks.deliver_sms.retry.assert_called_with(
|
||||||
queue="retry-tasks", countdown=0
|
queue="retry-tasks", countdown=0, expires=ANY
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -208,7 +209,7 @@ def test_should_go_into_technical_error_if_exceeds_retries_on_deliver_sms_task(
|
|||||||
assert str(sample_notification.id) in str(e.value)
|
assert str(sample_notification.id) in str(e.value)
|
||||||
|
|
||||||
provider_tasks.deliver_sms.retry.assert_called_with(
|
provider_tasks.deliver_sms.retry.assert_called_with(
|
||||||
queue="retry-tasks", countdown=0
|
queue="retry-tasks", countdown=0, expires=ANY
|
||||||
)
|
)
|
||||||
|
|
||||||
assert sample_notification.status == NotificationStatus.TEMPORARY_FAILURE
|
assert sample_notification.status == NotificationStatus.TEMPORARY_FAILURE
|
||||||
@@ -240,7 +241,7 @@ def test_should_add_to_retry_queue_if_notification_not_found_in_deliver_email_ta
|
|||||||
deliver_email(notification_id)
|
deliver_email(notification_id)
|
||||||
app.delivery.send_to_providers.send_email_to_provider.assert_not_called()
|
app.delivery.send_to_providers.send_email_to_provider.assert_not_called()
|
||||||
app.celery.provider_tasks.deliver_email.retry.assert_called_with(
|
app.celery.provider_tasks.deliver_email.retry.assert_called_with(
|
||||||
queue="retry-tasks"
|
queue="retry-tasks", expires=ANY
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -268,7 +269,9 @@ def test_should_go_into_technical_error_if_exceeds_retries_on_deliver_email_task
|
|||||||
deliver_email(sample_notification.id)
|
deliver_email(sample_notification.id)
|
||||||
assert str(sample_notification.id) in str(e.value)
|
assert str(sample_notification.id) in str(e.value)
|
||||||
|
|
||||||
provider_tasks.deliver_email.retry.assert_called_with(queue="retry-tasks")
|
provider_tasks.deliver_email.retry.assert_called_with(
|
||||||
|
queue="retry-tasks", expires=ANY
|
||||||
|
)
|
||||||
assert sample_notification.status == NotificationStatus.TECHNICAL_FAILURE
|
assert sample_notification.status == NotificationStatus.TECHNICAL_FAILURE
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -415,7 +415,7 @@ def test_check_for_missing_rows_in_completed_jobs_calls_save_email(
|
|||||||
),
|
),
|
||||||
{},
|
{},
|
||||||
queue="database-tasks",
|
queue="database-tasks",
|
||||||
expires=ANY
|
expires=ANY,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -356,7 +356,7 @@ def test_process_row_sends_letter_task(
|
|||||||
),
|
),
|
||||||
{},
|
{},
|
||||||
queue=expected_queue,
|
queue=expected_queue,
|
||||||
expires=ANY
|
expires=ANY,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user