queue: Do test retries in tests.

The lambda passed to `queue_json_publish` is used if
`settings.USING_RABBITMQ` is unset -- which is only true in tests.  As
such, this pattern causes failures to never actually retry within
tests.

This behaviour has existed ever since the outgoing webhook code was
introduced in 53a8b2ac87, with no explanation.  Not passing that
argument allows tests to verify the retry behaviour when webhooks
fail.
This commit is contained in:
Alex Vandiver
2022-11-03 12:12:33 -04:00
committed by Tim Abbott
parent 7dbd98d25c
commit eb7a2f2c38
2 changed files with 64 additions and 2 deletions

View File

@@ -437,4 +437,4 @@ def retry_event(
if event["failed_tries"] > MAX_REQUEST_RETRIES:
failure_processor(event)
else:
queue_json_publish(queue_name, event, lambda x: None)
queue_json_publish(queue_name, event)