diff --git a/integration/test/API/GalleyInternal.hs b/integration/test/API/GalleyInternal.hs index e6354cf195..5df6c94d54 100644 --- a/integration/test/API/GalleyInternal.hs +++ b/integration/test/API/GalleyInternal.hs @@ -85,6 +85,21 @@ getFederationStatus user domains = $ req & addJSONObject ["domains" .= domainList] +-- | Poll until the user's backend is fully connected to all given domains +assertFullyConnected :: + ( HasCallStack, + MakesValue user + ) => + user -> + [String] -> + App () +assertFullyConnected user domains = + eventually + $ bindResponse (getFederationStatus user domains) + $ \resp -> do + resp.status `shouldMatchInt` 200 + resp.json %. "status" `shouldMatch` "fully-connected" + -- | https://staging-nginz-https.zinfra.io/api-internal/swagger-ui/galley/#/galley/put_i_legalhold_whitelisted_teams__tid_ legalholdWhitelistTeam :: (HasCallStack, MakesValue uid, MakesValue tid) => tid -> uid -> App Response legalholdWhitelistTeam tid uid = do diff --git a/integration/test/Test/Conversation.hs b/integration/test/Test/Conversation.hs index 3dd5615c66..681df7f59f 100644 --- a/integration/test/Test/Conversation.hs +++ b/integration/test/Test/Conversation.hs @@ -526,6 +526,10 @@ testAddUnreachableUserFromFederatingBackend domain = do otherDomain <- make domain & asString [alice, bob, charlie, chad] <- createAndConnectUsers [ownDomain, otherDomain, cDom.berDomain, cDom.berDomain] + -- Wait for ownDomain <-> {fed2, dynamicC} to be fully connected before + -- creating the conversation, so a transient fed2 reachability blip under + -- dynamic-backend churn does not turn the create into a 533 (WPB-3797). + assertFullyConnected alice [otherDomain, cDom.berDomain] conv <- withWebSockets [bob, charlie] $ \wss -> do conv <-