Skip to content

test(integration): retry transient 533 in testSynchroniseUserRemovalNotification - #5442

Open
blackheaven wants to merge 1 commit into
developfrom
gdifolco/fix-flaky-tests-testSynchroniseUserRemovalNotification
Open

test(integration): retry transient 533 in testSynchroniseUserRemovalNotification#5442
blackheaven wants to merge 1 commit into
developfrom
gdifolco/fix-flaky-tests-testSynchroniseUserRemovalNotification

Conversation

@blackheaven

Copy link
Copy Markdown
Contributor

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

…otification

Conversation.testSynchroniseUserRemovalNotification[domain=other] failed
intermittently in CI: creating a Proteus conversation with members on two
remote backends returned HTTP 533 with
`unreachable_backends: [<run>-fed2-fed…]` instead of the expected 201. The
sibling fed-v0/v1/v2 variants passed in the same run and the body named only the
static fed2 backend as unreachable (the dynamic backend was reachable),
indicating a transient federation-ping failure rather than a hard outage.

Root cause: conversation creation fans out to every remote backend and pings
each in registerRemoteConversationMemberships
(Wire.ConversationSubsystem.Util). ensureNoUnreachableBackends
(Wire.FederationSubsystem) fails fast on the first unreachable backend with zero
retries, so a single transient ping failure (connection refused, TLS handshake,
DNS) surfaces as 533.

Fix is test-layer only; production stays fail-fast. Promote the existing
retryTransient helper from a local `where` binding in
Test/Migration/Conversation.hs to a shared top-level definition in Testlib.App
(re-exported via Testlib.Prelude), wrap the postConversation call in
testSynchroniseUserRemovalNotification, and delete the now-duplicated local
copy. retryTransient retries on {500,422,521,525,533} with exponential backoff
capped at a cumulative 30s, so genuine failures still surface. The single
call-site edit covers all four StaticDomain variants (other/fed-v0/v1/v2) since
they share it.

The retry is idempotent: on 533, deleteOnUnreachable
(Wire.ConversationSubsystem.Util) deletes the local conversation before
re-throwing, so re-issuing the create cannot corrupt state.

Verified: `cabal build integration` is clean under -Werror (the move surfaced and
fixed a now-redundant `import Control.Concurrent (threadDelay)` in the migration
file); `./dist/integration --list` confirms discovery. Runtime confirmation of
the four variants is CI-only (integration tests require the k8s federation
stack).
@blackheaven
blackheaven requested a review from a team as a code owner August 11, 2026 13:38
@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants