File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1+ {-# LANGUAGE LambdaCase #-}
12module Test.Hls
23 ( module Test.Tasty.HUnit ,
34 module Test.Tasty ,
@@ -19,7 +20,7 @@ module Test.Hls
1920where
2021
2122import Control.Applicative.Combinators
22- import Control.Concurrent.Async (async , wait )
23+ import Control.Concurrent.Async (async , cancel , wait )
2324import Control.Exception.Base
2425import Control.Monad.IO.Class
2526import Data.ByteString.Lazy (ByteString )
@@ -119,6 +120,7 @@ runSessionWithServer' plugin conf sconf caps root s = silenceStderr $ do
119120 x <-
120121 runSessionWithHandles inW outR sconf caps root s
121122 `finally` setCurrentDirectory cwd
122- wait server
123- sleep 0.3
123+ timeout 3 (wait server) >>= \ case
124+ Just () -> pure ()
125+ Nothing -> putStrLn " Server does not exit on time, canceling the async task..." >> cancel server
124126 pure x
You can’t perform that action at this time.
0 commit comments