From b4ed5b313b695da670e3bbb0bdc50acdaed73214 Mon Sep 17 00:00:00 2001 From: Gautier DI FOLCO Date: Fri, 3 Jul 2026 12:48:27 +0200 Subject: [PATCH 1/2] spar-integration: retry transient 5xx on client delete in re-auth test The "password user that was upgraded to SCIM has to provide password" test hit an intermittent brig 500 on DELETE /clients/:cid (an opaque transient, likely a backend read under load). Reuse the existing retryNUntil helper (Control.Retry) to retry the idempotent delete on transient 5xx, then assert the expected status -- so a transient 500 no longer fails the test, while genuine failures still surface. --- .../test-integration/Test/Spar/APISpec.hs | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/services/spar/test-integration/Test/Spar/APISpec.hs b/services/spar/test-integration/Test/Spar/APISpec.hs index 315d798378..6d0e207baa 100644 --- a/services/spar/test-integration/Test/Spar/APISpec.hs +++ b/services/spar/test-integration/Test/Spar/APISpec.hs @@ -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] + transientRetries = 10 ---------------------------------------------------------------------- -- tests for bsi audit From bd30c6dcef5bc773eddb5f2f765d65e1436a4bd2 Mon Sep 17 00:00:00 2001 From: Gautier DI FOLCO Date: Fri, 3 Jul 2026 15:26:15 +0200 Subject: [PATCH 2/2] Hello CI