Commit 69e6b24e authored by kili's avatar kili
Browse files

Make this test a little more stable

On slow machines, ghci can take more than one second to launch,
which produces confusing failure output like

+cat: 3171.pid: No such file or directory
+usage: kill [-s signame | -signum | -signame] { job | pid | pgrp } ...
+       kill -l [exit_status ...]

Fix this by

1) increasing the time before sending a SIGINT from 1 to 2 seconds,
2) running the test program in the background and asking the shell for
   its pid instead of relying on the program to write the pid file
   quick enough.

Of course you'll still see failures on *very* slow or overloaded
machines; that would probably a stderr diff like `-Interrupted'.
parent 7893fd9b
......@@ -4,5 +4,6 @@ include $(TOP)/mk/test.mk
# Test that threadDelay can be interrupted by ^C.
3171:
(sleep 1; kill -INT `cat 3171.pid`) & \
echo "do System.Posix.getProcessID >>= writeFile \"3171.pid\" . show; Control.Concurrent.threadDelay 3000000; putStrLn \"threadDelay was not interrupted\"" | $(TEST_HC) -v0 --interactive 2>3171.err
echo "do Control.Concurrent.threadDelay 3000000; putStrLn \"threadDelay was not interrupted\"" | \
$(TEST_HC) -v0 --interactive 2>3171.err & \
sleep 2; kill -INT $$!; wait
Supports Markdown
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