Skip to content

Commit

Permalink
Call abortServer on test timeout.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaol committed Nov 4, 2024
1 parent dbce2db commit 7246d87
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions futhark.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ library
aeson >=2.0.0.0
, ansi-terminal >=0.6.3.1
, array >=0.4
, async >=2.0
, base >=4.15 && <5
, base16-bytestring
, binary >=0.8.3
Expand Down
10 changes: 9 additions & 1 deletion src/Futhark/CLI/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module Futhark.CLI.Test (main) where

import Control.Applicative.Lift (Errors, Lift (..), failure, runErrors)
import Control.Concurrent
import Control.Concurrent.Async
import Control.Exception
import Control.Monad
import Control.Monad.Except (ExceptT (..), MonadError, runExceptT, withExceptT)
Expand Down Expand Up @@ -105,7 +106,14 @@ withProgramServer program runner extra_options f = do
context prog_ctx $
pureTestResults $
liftIO $
withServer (futharkServerCfg to_run to_run_args) f
withServer (futharkServerCfg to_run to_run_args) $ \server ->
race (threadDelay $ 5 * 60 * 1000000) (f server) >>= \case
Left _ -> do
abortServer server

Check failure on line 112 in src/Futhark/CLI/Test.hs

View workflow job for this annotation

GitHub Actions / build-linux-cabal

Variable not in scope: abortServer :: Server -> IO a0

Check failure on line 112 in src/Futhark/CLI/Test.hs

View workflow job for this annotation

GitHub Actions / build-windows-cabal

Variable not in scope: abortServer :: Server -> IO a0

Check failure on line 112 in src/Futhark/CLI/Test.hs

View workflow job for this annotation

GitHub Actions / build-windows-cabal

Variable not in scope: abortServer :: Server -> IO a0

Check failure on line 112 in src/Futhark/CLI/Test.hs

View workflow job for this annotation

GitHub Actions / build-windows-cabal

Variable not in scope: abortServer :: Server -> IO a0
-- This value won't be used since abortServer will
-- already cause a non-zero status for wait.
pure undefined
Right r -> pure r

data TestMode
= -- | Only type check.
Expand Down

0 comments on commit 7246d87

Please sign in to comment.