Scalable Email Infrastructure: Week 11

by Sonika Chowdary Gutha

week
gsoc
gsoc2026
ScalableEmailInfrastructure
week#11

Summary

Week 11 focused on reviewing and strengthening the testing coverage for the email infrastructure. I went back to the testing strategy from the original proposal and checked it against the current test suite, file by file, to see how much of the planned coverage is in place.

What is covered

Most of the planned testing is already covered, and in a few areas the current coverage goes beyond what was originally outlined. EmailQueueService has coverage for both the database write and the Redis push, including the case where Redis fails but the database write still succeeds. The worker’s status transitions are covered across the main scenarios successful processing, transient failures that schedule a retry, exhausted attempts moving to failed, and unsupported actions being cancelled instead of retried.

Retry backoff has a dedicated test to verify that the delay increases with the attempt count, as specified in the proposal. The watchdog has particularly strong coverage, with tests for resetting stuck jobs, leaving recently locked jobs untouched, ignoring sent jobs, and correctly handling stuck jobs depending on whether they have attempts remaining. The core rate limiting behavior is covered as well, including per email and per-IP limits, fail open and fail closed behavior when Redis is unavailable, and TTL repair.

Additional coverage worked on

While going through the test plan, I also worked on strengthening a few areas where the existing coverage could be improved: