[commit: ghc] ghc-8.0: Disable T-signals-child test on single-threaded runtime (1aaa6f6)
git at git.haskell.org
git at git.haskell.org
Fri Oct 14 18:48:10 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : ghc-8.0
Link : http://ghc.haskell.org/trac/ghc/changeset/1aaa6f62f4330cefad2a0f89ca8ffd70b62c455a/ghc
>---------------------------------------------------------------
commit 1aaa6f62f4330cefad2a0f89ca8ffd70b62c455a
Author: Michael Snoyman <michael at snoyman.com>
Date: Fri Oct 14 10:53:40 2016 -0400
Disable T-signals-child test on single-threaded runtime
As identified by Joachim, this test broke the Travis build. It appears
that this is due to the usage of the single-threaded runtime there. I've
confirmed that this fix causes the Travis build to pass:
https://travis-ci.org/snoyberg/ghc/builds/167368988.
Test Plan: Confirm tests now pass
Reviewers: austin, nomeata, bgamari
Reviewed By: nomeata, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2593
(cherry picked from commit 0d9524a813a381dd13d461e731fc4ec8c0404aef)
>---------------------------------------------------------------
1aaa6f62f4330cefad2a0f89ca8ffd70b62c455a
testsuite/tests/runghc/T-signals-child.hs | 9 +++++++--
testsuite/tests/runghc/all.T | 4 +++-
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/testsuite/tests/runghc/T-signals-child.hs b/testsuite/tests/runghc/T-signals-child.hs
index 21c1b64..ee36f62 100644
--- a/testsuite/tests/runghc/T-signals-child.hs
+++ b/testsuite/tests/runghc/T-signals-child.hs
@@ -1,7 +1,7 @@
import Control.Concurrent.MVar (readMVar)
import System.Environment (getArgs)
import System.Exit (ExitCode (ExitFailure), exitFailure)
-import System.IO (hGetLine, hPutStrLn)
+import System.IO (hClose, hGetLine, hPutStrLn)
import System.Posix.Process (exitImmediately, getProcessID)
import System.Posix.Signals (Handler (Catch), installHandler, sigHUP,
signalProcess)
@@ -9,6 +9,7 @@ import System.Process (StdStream (CreatePipe), createProcess, proc,
std_in, std_out, waitForProcess)
import System.Process.Internals (ProcessHandle (..),
ProcessHandle__ (OpenHandle))
+import System.Timeout (timeout)
main :: IO ()
main = do
@@ -46,6 +47,7 @@ runParent runghc = do
-- Send the child some input so that it will exit if it didn't
-- have a sigHUP handler installed.
hPutStrLn inH ""
+ hClose inH
-- Read out the rest of stdout from the child, which will be
-- either "NOSIGNAL\n" or "HUP\n"
@@ -95,7 +97,10 @@ runChild = do
-- Block until we receive input, giving a chance for the signal
-- handler to be triggered, and if the signal handler isn't
-- triggered, gives us an escape route from this function.
- _ <- getLine
+ --
+ -- Include a reasonable timeout to prevent this from running for
+ -- too long
+ _ <- timeout 10000000 getLine
-- Reaching this point indicates a failure of the test. Print some
-- non HUP message and exit with a non HUP exit
diff --git a/testsuite/tests/runghc/all.T b/testsuite/tests/runghc/all.T
index ef3cb94..36cd6da 100644
--- a/testsuite/tests/runghc/all.T
+++ b/testsuite/tests/runghc/all.T
@@ -5,6 +5,8 @@ test('T8601', req_interp, run_command,
['$MAKE --no-print-directory -s T8601'])
test('T-signals-child',
- [when(opsys('mingw32'), skip), req_interp],
+ [ when(opsys('mingw32'), skip), req_interp
+ , only_ways(['threaded1', 'threaded2'])
+ ],
run_command,
['$MAKE --no-print-directory -s T-signals-child'])
More information about the ghc-commits
mailing list