Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: non-zero windows test ghci exit code #10307

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion cabal-testsuite/src/Test/Cabal/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import Foreign.C.Error (Errno (..), ePIPE)

import qualified GHC.IO.Exception as GHC

import Distribution.System
import Distribution.Verbosity

import System.Process.Internals
Expand Down Expand Up @@ -306,7 +307,13 @@ stopServer s = do
-- will actually die, and then hClose will fail because
-- the ":quit" command was buffered up but never got
-- flushed.
interruptProcessGroupOf (serverProcessHandle s)
--
-- On the "happy path" which is this soft killer, interrupting the
-- process on Windows would be an actual abortion of the program,
-- with a non-zero exit-code. Not doing this on Windows ensures that
-- the "happy path" if chosen, would exit with exit-code zero.
when (buildOS /= Windows) $
interruptProcessGroupOf (serverProcessHandle s)

log ServerMeta s $ "Waiting..."
-- Close input BEFORE waiting, close output AFTER waiting.
Expand Down
Loading