Stop 'timing out' old 'created' notifications

This is being replaced with a new alert and runbook [1]. It's not
always appropriate to change the status to 'technical-failure', and
the new alert means we'll act to fix the underlying issue promptly.

We'll look at tidying up the remaining code in the next commits.

[1]: https://github.com/alphagov/notifications-manuals/wiki/Support-Runbook#deal-with-email-or-sms-still-in-created
This commit is contained in:
Ben Thorner
2021-11-25 16:59:26 +00:00
parent 2acc4ee67d
commit 0318229216
4 changed files with 11 additions and 27 deletions

View File

@@ -28,7 +28,6 @@ from app.celery.service_callback_tasks import (
create_delivery_status_callback_data,
)
from app.config import QueueNames
from app.exceptions import NotificationTechnicalFailureException
from app.models import EMAIL_TYPE, LETTER_TYPE, SMS_TYPE, FactProcessingTime
from tests.app.db import (
create_job,
@@ -184,11 +183,9 @@ def test_update_status_of_notifications_after_timeout(notify_api, sample_templat
status='pending',
created_at=datetime.utcnow() - timedelta(
seconds=current_app.config.get('SENDING_NOTIFICATIONS_TIMEOUT_PERIOD') + 10))
with pytest.raises(NotificationTechnicalFailureException) as e:
timeout_notifications()
assert str(not2.id) in str(e.value)
timeout_notifications()
assert not1.status == 'temporary-failure'
assert not2.status == 'technical-failure'
assert not2.status == 'created'
assert not3.status == 'temporary-failure'