Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions services/spar/test-integration/Test/Spar/APISpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1669,22 +1669,25 @@ specReAuthSsoUserWithPassword =
newClientVerificationCode = Nothing
}

deleteClient :: (MonadIO m, MonadReader TestEnv m) => BrigReq -> UserId -> ClientId -> Maybe Text -> Int -> m ()
deleteClient brig u c pw expectedStatus =
void $
call $
delete $
brig
. paths ["clients", toByteString' c]
. zUser u
. zConn "conn"
. contentJson
. body payload
. expectStatus ((==) expectedStatus)
deleteClient :: (HasCallStack, MonadIO m, MonadReader TestEnv m) => BrigReq -> UserId -> ClientId -> Maybe Text -> Int -> m ()
deleteClient brig u c pw expectedStatus = do
resp <-
retryNUntil transientRetries (\r -> statusCode r `notElem` transientStatuses) $
call $
delete $
brig
. paths ["clients", toByteString' c]
. zUser u
. zConn "conn"
. contentJson
. body payload
liftIO $ statusCode resp `shouldBe` expectedStatus
where
payload =
RequestBodyLBS . encode . object . maybeToList $
fmap ("password" .=) pw
transientStatuses = [500, 502, 503, 504]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we shouldn't retry here, but find out why brig is failing with 5xx and fix that.

transientRetries = 10

----------------------------------------------------------------------
-- tests for bsi audit
Expand Down