diff --git a/testsuite/tests/rts/T12903.hs b/testsuite/tests/rts/T12903.hs index ddaf8b97e8adb771b51c8e78d7c921d47a7a8b04..e4a8486a38d4b7698f6708108268f4fcea60b075 100644 --- a/testsuite/tests/rts/T12903.hs +++ b/testsuite/tests/rts/T12903.hs @@ -1,10 +1,21 @@ import Control.Concurrent import Control.Exception +import System.IO import System.Posix +import System.Posix.IO main = do + (pout1, pin1) <- createPipe + (pout2, _) <- createPipe pid <- forkProcess $ do - handle (\UserInterrupt{} -> putStrLn "caught") - $ threadDelay 2000000 + hdl <- fdToHandle pin1 + 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 - threadDelay 2000000 + putStrLn =<< hGetLine hdl diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T index c44ec04a3444c25910c01bc6a9b4db0ce46bdd04..a645ad3a4eea300e548352f59e7cf522e8b709d2 100644 --- a/testsuite/tests/rts/all.T +++ b/testsuite/tests/rts/all.T @@ -376,9 +376,5 @@ test('T12497', [ unless(opsys('mingw32'), skip) ], run_command, ['$MAKE -s --no-print-directory T12497']) -# Test is being skipped on darwin due to it's flakiness. -# See 12956 -test('T12903', [when(opsys('mingw32'), skip), - when(opsys('darwin'), skip)], - compile_and_run, ['']) +test('T12903', [when(opsys('mingw32'), skip)], compile_and_run, [''])