Port final lab 5 validation, session and PNG recovery fixes
This commit is contained in:
@@ -248,14 +248,20 @@ async def test_message_off_the_schema_goes_to_the_dead_letter_queue(
|
||||
assert depth(rabbitmq, "attachments.process") == 0
|
||||
|
||||
|
||||
async def test_failed_processing_is_requeued_and_retried(rabbitmq: dict[str, Any]) -> None:
|
||||
@pytest.mark.parametrize("failures", [1, 12])
|
||||
async def test_failed_processing_is_requeued_and_retried(
|
||||
rabbitmq: dict[str, Any], failures: int
|
||||
) -> None:
|
||||
recorder, sent = Recorder(), job()
|
||||
recorder.failures = 1
|
||||
recorder.failures = failures
|
||||
before = depth(rabbitmq, "attachments.process.dlq")
|
||||
async with publisher(rabbitmq) as jobs:
|
||||
await jobs.publish(sent.id, body(sent.payload()))
|
||||
async with worker(rabbitmq, recorder):
|
||||
await wait_for(lambda: recorder.jobs)
|
||||
await wait_for(lambda: recorder.jobs, seconds=40)
|
||||
await wait_for(lambda: depth(rabbitmq, "attachments.process") == 0)
|
||||
assert recorder.jobs == [sent]
|
||||
assert depth(rabbitmq, "attachments.process.dlq") == before
|
||||
|
||||
|
||||
async def test_worker_account_cannot_publish(rabbitmq: dict[str, Any]) -> None:
|
||||
|
||||
Reference in New Issue
Block a user