Skip to content
This repository has been archived by the owner on Mar 22, 2021. It is now read-only.

Commit

Permalink
Merge pull request #76 from jneira/fix-win-hang
Browse files Browse the repository at this point in the history
Remove waitForProcess in finalizer
  • Loading branch information
lukel97 authored Sep 17, 2020
2 parents 9e3fed2 + 753acba commit 0213715
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Language/Haskell/LSP/Test/Session.hs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ import Language.Haskell.LSP.Test.Exceptions
import System.Console.ANSI
import System.Directory
import System.IO
import System.Process (waitForProcess, ProcessHandle())
import System.Process (ProcessHandle())
#ifndef mingw32_HOST_OS
import System.Process (waitForProcess)
#endif
import System.Timeout

-- | A session representing one instance of launching and connecting to a server.
Expand Down Expand Up @@ -271,7 +274,10 @@ runSessionWithHandles serverIn serverOut serverProc serverHandler config caps ro
-- handles etc via cleanupProcess
killThread tid
-- Give the server some time to exit cleanly
-- It makes the server hangs in windows so we have to avoid it
#ifndef mingw32_HOST_OS
timeout msgTimeoutMs (waitForProcess serverProc)
#endif
cleanupProcess server

(result, _) <- bracket serverListenerLauncher
Expand Down

0 comments on commit 0213715

Please sign in to comment.