Skip to content

Add Polly retry logic to fix flaky email verification integration test - #176

Merged
oveldman merged 6 commits into
mainfrom
bugfix/171-failure-integration-tests
Jul 6, 2026
Merged

Add Polly retry logic to fix flaky email verification integration test#176
oveldman merged 6 commits into
mainfrom
bugfix/171-failure-integration-tests

Conversation

@oveldman

@oveldman oveldman commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

The ThenTheAdministratorShouldHaveReceivedAnEmailWithSubject step was failing intermittently because the Mailpit API was polled once immediately after sending feedback, before the mail had been delivered. Replaced the single request with a Polly retry pipeline that retries up to 10 times (200ms delay) until the expected email subject appears.

Changes

  • Add Polly.Core 8.7.0 to Directory.Packages.props and Api.IntegrationTests.csproj
  • Rewrite the email-check step in CorrespondencesSteps to use a ResiliencePipeline with RetryStrategyOptions — retries until the expected subject is found or 10 attempts are exhausted
  • Use the TState overload of ExecuteAsync with a static lambda to avoid closure allocation
  • Add Polly to UsefulLinks.md

How to Test

  • Run the correspondence integration tests: dotnet test tests/MadWorldEU.Byakko.Controller.Api.IntegrationTests/ -f Correspondences
  • Verify the ThenTheAdministratorShouldHaveReceivedAnEmailWithSubject step passes consistently across multiple runs

Checklist

  • Code builds without errors
  • Changes have been tested locally
  • No new warnings introduced

@oveldman oveldman self-assigned this Jul 6, 2026
@oveldman oveldman added the bug Something isn't working label Jul 6, 2026
@sonarqubecloud

sonarqubecloud Bot commented Jul 6, 2026

Copy link
Copy Markdown

@oveldman
oveldman merged commit e1864ca into main Jul 6, 2026
10 checks passed
@oveldman
oveldman deleted the bugfix/171-failure-integration-tests branch July 6, 2026 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integration test "Send feedback as an authenticated user" fails intermittently due to async email timing

1 participant