base: Add test for #8684
authorBen Gamari <bgamari.foss@gmail.com>
Wed, 5 Apr 2017 00:48:35 +0000 (20:48 -0400)
committerBen Gamari <ben@smart-cactus.org>
Wed, 5 Apr 2017 00:48:36 +0000 (20:48 -0400)
Reviewers: austin, hvr

Subscribers: rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D3420

libraries/base/tests/T8684.hs [new file with mode: 0644]
libraries/base/tests/all.T

diff --git a/libraries/base/tests/T8684.hs b/libraries/base/tests/T8684.hs
new file mode 100644 (file)
index 0000000..87a3769
--- /dev/null
@@ -0,0 +1,16 @@
+import Control.Concurrent
+import System.IO
+import System.Timeout
+
+main :: IO ()
+main = do
+    forkIO $ do
+        threadDelay (5 * 1000000)
+        -- The timeout should terminate before we ever make it here
+        putStrLn "t=5 seconds: we shouldn't be here"
+
+    timeout (1 * 1000000) $ do
+        hWaitForInput stdin (10 * 1000)
+        putStrLn "we shouldn't be here"
+
+    return ()
index 49298d3..69705bc 100644 (file)
@@ -189,6 +189,7 @@ test('T9681', normal, compile_fail, [''])
 test('T8089',
      [exit_code(99), run_timeout_multiplier(0.01)],
      compile_and_run, [''])
+test('T8684', expect_broken(8684), compile_and_run, [''])
 test('T9826',normal, compile_and_run,[''])
 test('T9848',
         [ stats_num_field('bytes allocated',