Skip to content

Commit

Permalink
Merge pull request lukel97/lsp-test#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 c183fe3 + c2207a7 commit 75435eb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lsp-test/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 75435eb

Please sign in to comment.