From 09348c46f793b0eeae699e897bad4ec4fb476348 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin Date: Fri, 23 May 2025 11:30:02 +0100 Subject: [PATCH] sync between tests --- tests/SMPClient.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/SMPClient.hs b/tests/SMPClient.hs index 69e670b06..7eb49fc38 100644 --- a/tests/SMPClient.hs +++ b/tests/SMPClient.hs @@ -37,6 +37,7 @@ import Simplex.Messaging.Version import Simplex.Messaging.Version.Internal import System.Environment (lookupEnv) import System.Info (os) +import System.Process (callCommand) import Test.Hspec hiding (fit, it) import UnliftIO.Concurrent import qualified UnliftIO.Exception as E @@ -302,7 +303,7 @@ serverBracket process afterProcess f = do started <- newEmptyTMVarIO E.bracket (forkIOWithUnmask (\unmask -> unmask (process started) `E.catchAny` handleStartError started)) - (\t -> killThread t >> afterProcess >> waitFor started "stop") + (\t -> killThread t >> afterProcess >> waitFor started "stop" >> callCommand "sync") (\t -> waitFor started "start" >> f t >>= \r -> r <$ threadDelay 100000) where -- it putTMVar is called twise to unlock both parts of the bracket in case of start failure