tests: fix sporadic failures from reading stats (#975)

This commit is contained in:
Alexander Bondarenko
2024-01-30 13:36:07 +02:00
committed by GitHub
parent 7a0cd8041b
commit cb64dabf75

View File

@@ -130,7 +130,7 @@ serverBracket process afterProcess f = do
E.bracket
(forkIOWithUnmask ($ process started))
(\t -> killThread t >> afterProcess >> waitFor started "stop")
(\t -> waitFor started "start" >> f t)
(\t -> waitFor started "start" >> f t >>= \r -> r <$ threadDelay 100000)
where
waitFor started s =
5_000_000 `timeout` atomically (takeTMVar started) >>= \case