diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2025-06-21 13:58:46 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2025-06-21 15:59:51 +0200 |
commit | 06df252ce401f7701f1d830d1867fedda1b36d05 (patch) | |
tree | 5e5a044a71a6fa8f151ce581afa1aae34cbaf4e9 /src/Run.hs | |
parent | b7eb345a88df9ee87080fe776722f12e911b773f (diff) |
Multiply-timeout command
Changelog: Added `multiply_timeout` command
Diffstat (limited to 'src/Run.hs')
-rw-r--r-- | src/Run.hs | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -59,6 +59,7 @@ runTest out opts gdefs test = do failedVar <- newTVarIO Nothing objIdVar <- newMVar 1 procVar <- newMVar [] + timeoutVar <- newMVar $ optTimeout opts mgdb <- if optGDB opts then flip runReaderT out $ do @@ -72,6 +73,7 @@ runTest out opts gdefs test = do , teOptions = opts , teNextObjId = objIdVar , teProcesses = procVar + , teTimeout = timeoutVar , teGDB = fst <$> mgdb } tstate = TestState @@ -313,7 +315,7 @@ exprFailed desc sline pname exprVars = do expect :: SourceLine -> Process -> Traced Regex -> [TypedVarName Text] -> ([ Text ] -> TestRun ()) -> TestRun () expect sline p (Traced trace re) tvars inner = do - timeout <- asks $ optTimeout . teOptions . fst + timeout <- liftIO . readMVar =<< asks (teTimeout . fst) delay <- liftIO $ registerDelay $ ceiling $ 1000000 * timeout mbmatch <- atomicallyTest $ (Nothing <$ (check =<< readTVar delay)) <|> do line <- readTVar (procOutput p) |