From ed6d95dde5f12727cfa06b851c70b07cb415e9d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sun, 14 Sep 2025 21:02:50 +0200 Subject: Support zero timeout Changelog: Support zero as a timeout multiplyer --- src/Run.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Run.hs') diff --git a/src/Run.hs b/src/Run.hs index 2e5d641..f7071b9 100644 --- a/src/Run.hs +++ b/src/Run.hs @@ -60,7 +60,7 @@ runTest out opts gdefs test = do failedVar <- newTVarIO Nothing objIdVar <- newMVar 1 procVar <- newMVar [] - timeoutVar <- newMVar $ optTimeout opts + timeoutVar <- newMVar ( optTimeout opts, 0 ) mgdb <- if optGDB opts then flip runReaderT out $ do @@ -321,7 +321,7 @@ exprFailed desc stack pname = do expect :: SourceLine -> Process -> Traced Regex -> [TypedVarName Text] -> ([ Text ] -> TestRun ()) -> TestRun () expect sline p (Traced trace re) tvars inner = do - timeout <- liftIO . readMVar =<< asks (teTimeout . fst) + timeout <- getCurrentTimeout delay <- liftIO $ registerDelay $ ceiling $ 1000000 * timeout mbmatch <- atomicallyTest $ (Nothing <$ (check =<< readTVar delay)) <|> do line <- readTVar (procOutput p) -- cgit v1.2.3