| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Test.Migration.Util
Synopsis
- waitForMigration :: HasCallStack => String -> String -> App ()
- assertMigrationSuccessful :: HasCallStack => String -> String -> App ()
- retryTransient :: App Response -> App Response
Documentation
waitForMigration :: HasCallStack => String -> String -> App () Source #
assertMigrationSuccessful :: HasCallStack => String -> String -> App () Source #
retryTransient :: App Response -> App Response Source #
Retry a request on transient errors, bounded by a cumulative cap so genuine failures still surface.
Retryable statuses: * 500 — transient server errors under load: during the user-migration phase the background worker holds per-user Postgres advisory locks and brig's dual Cassandra/Postgres reads time out acquiring their shared locks; spar rethrows such brig errors on SCIM reads. Also covers spar-side Cassandra timeouts under burst load. * 422 — observed transiently during migration test runs. * 521 525 533 — federation cold-start errors when a freshly (re)started dynamic backend is hit with a parallel fan-out (connection refused, SSL, unreachable / unexpected federation response).
Safe to wrap unconditionally only for idempotent reads — a retried mutation can duplicate effects. Test.Migration.Conversation deliberately also wraps federation-facing mutations (conversation create, membership changes) during migration cold-start, where the transient 521525533 window would otherwise flake.