Why CI Email Tests Need a Canary Message
Описание и применение
В CI‑тестах электронной почты часто возникает неясная ошибка «не получено письмо для подтверждения». Добавление контрольного сообщения (канарейки) позволяет различать проблемы инфраструктуры и приложения, ускоряя отладку.
Задача
CI email tests often fail with a vague “verification email not received” message, making it hard to identify whether the failure is due to the application, email provider, mailbox, or test runner.
Результат
Adding a canary message splits failures into environment/mailbox problems and application delivery problems, reducing false positives and guiding faster debugging.
Рабочий процесс
- Allocate a mailbox owned by the current test run
- Send a canary message with a unique subject
- Wait for the canary using normal polling code
- If canary arrives, execute the user-facing email flow
- Wait for the product email and assert its contents
- Classify failures with reason codes
- Record minimal artifacts for triage
- Release or schedule cleanup of the mailbox
Доказательства
A small canary message makes this easier to diagnose. Before testing the real workflow, send a known message through the same inbox path and record whether it arrives.
If the canary fails, the result is probably an environment or inbox problem. If it passes but the verification message fails, the application path deserves attention.
Give the CI result a reason code instead of a generic timeout: canary_missing, product_missing, wrong_owner, late_delivery, invalid_token.
- Дата записи: 2026-11-01T04:13:55.240Z