diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2025-09-14 21:02:50 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2025-09-15 21:11:01 +0200 |
commit | ed6d95dde5f12727cfa06b851c70b07cb415e9d6 (patch) | |
tree | 57056b70fc9930db23f29597004dd35fbb70fafc /src/Run.hs | |
parent | 8e3d03e55793b49dc6844b23877c84d111e8d7d1 (diff) |
Support zero timeout
Changelog: Support zero as a timeout multiplyer
Diffstat (limited to 'src/Run.hs')
-rw-r--r-- | src/Run.hs | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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) |