Skip to content

Add test for retry exhaustion moving task to failed queue#70

Open
tejakusireddy wants to merge 1 commit intomicrosoft:mainfrom
tejakusireddy:test-retry-exhaustion-deletes-failed-task
Open

Add test for retry exhaustion moving task to failed queue#70
tejakusireddy wants to merge 1 commit intomicrosoft:mainfrom
tejakusireddy:test-retry-exhaustion-deletes-failed-task

Conversation

@tejakusireddy
Copy link
Copy Markdown
Contributor

Summary

Adds a non-live test covering retry exhaustion behavior for storage-backed queues.

The test verifies that when a task has no retries left and the callback fails, pull_and_execute() returns False, removes the task from the main queue, and moves the serialized task to the failed queue.

Testing

  • ruff check tests/test_api.py
  • pytest tests/test_api.py::test_retry_exhaustion_moves_task_to_failed_queue -q
  • pytest tests/test_api.py -q
  • git diff --check

@tejakusireddy tejakusireddy requested a review from a team May 4, 2026 16:22
@temporaer
Copy link
Copy Markdown
Contributor

temporaer commented May 4, 2026

@tejakusireddy , if you plan to submit more regularly, installing the pre-commit hook might be worth it :-) it catches all these linting errors before committing/pushing.

@tejakusireddy tejakusireddy force-pushed the test-retry-exhaustion-deletes-failed-task branch from e09f547 to 9fe4105 Compare May 4, 2026 16:44
@temporaer
Copy link
Copy Markdown
Contributor

temporaer commented May 4, 2026

@tejakusireddy , can you describe why you think this particular test is important to have? Any ideas about making this work for service bus backend?

@tejakusireddy
Copy link
Copy Markdown
Contributor Author

tejakusireddy commented May 4, 2026

@temporaer Thanks, I’ll set up the pre-commit hook before sending more PRs.

For this test, I added it because retry exhaustion is the terminal failure path for storage-backed queues. When num_retries reaches 0, the worker should return False, remove the task from the active queue, and preserve the serialized task in the failed queue. I didn’t see a focused non-live test covering that behavior.

For Service Bus, the equivalent path would be DLQ/dead-letter behavior rather than the storage failed queue. I kept this PR storage-focused to avoid adding another live Service Bus test, but a follow-up could cover the Service Bus path either with a mocked backend/envelope unit test or a live DLQ test if that’s preferred.

@temporaer
Copy link
Copy Markdown
Contributor

@tejakusireddy thank you. While adding tests is good work, especially bug fixes and feature contributions are welcomed.

@tejakusireddy
Copy link
Copy Markdown
Contributor Author

@temporaer Makes sense, thanks for the guidance. I’ll focus future contributions more on small bug fixes or feature improvements, with tests included where appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants