Commit aa123f44 authored by Alexander Vershilov's avatar Alexander Vershilov Committed by Ben Gamari

Fix testcase T12903 on OS X

Old test used timeouts that leads to the various sporadic errors.
Tet was rewritten to not use timeouts.

Reviewers: austin, erikd, simonmar, bgamari

Reviewed By: simonmar

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #12956
parent 9cb4a130
import Control.Concurrent import Control.Concurrent
import Control.Exception import Control.Exception
import System.IO
import System.Posix import System.Posix
import System.Posix.IO
main = do main = do
(pout1, pin1) <- createPipe
(pout2, _) <- createPipe
pid <- forkProcess $ do pid <- forkProcess $ do
handle (\UserInterrupt{} -> putStrLn "caught") hdl <- fdToHandle pin1
$ threadDelay 2000000 hSetBuffering hdl LineBuffering
handle (\UserInterrupt{} -> hPutStrLn hdl "caught")
$ do hPutStrLn hdl "registered"
hdl2 <- fdToHandle pout2
putStrLn =<< hGetLine hdl2
hdl <- fdToHandle pout1
hSetBuffering hdl LineBuffering
"registered" <- hGetLine hdl
signalProcess sigINT pid signalProcess sigINT pid
threadDelay 2000000 putStrLn =<< hGetLine hdl
...@@ -376,9 +376,5 @@ test('T12497', [ unless(opsys('mingw32'), skip) ...@@ -376,9 +376,5 @@ test('T12497', [ unless(opsys('mingw32'), skip)
], ],
run_command, ['$MAKE -s --no-print-directory T12497']) run_command, ['$MAKE -s --no-print-directory T12497'])
# Test is being skipped on darwin due to it's flakiness. test('T12903', [when(opsys('mingw32'), skip)], compile_and_run, [''])
# See 12956
test('T12903', [when(opsys('mingw32'), skip),
when(opsys('darwin'), skip)],
compile_and_run, [''])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment