Rodrigo Mesquita pushed to branch wip/romes/multi-threaded-debugger at Glasgow Haskell Compiler / GHC
Commits:
-
15b5c741
by Rodrigo Mesquita at 2026-10-22T11:16:56+01:00
4 changed files:
- testsuite/tests/ghci/should_run/Makefile
- testsuite/tests/ghci/should_run/T3171.stdout
- + testsuite/tests/ghci/should_run/T3171ext.stdout
- testsuite/tests/ghci/should_run/all.T
Changes:
| ... | ... | @@ -3,10 +3,20 @@ include $(TOP)/mk/boilerplate.mk |
| 3 | 3 | include $(TOP)/mk/test.mk
|
| 4 | 4 | |
| 5 | 5 | # Test that threadDelay can be interrupted by ^C.
|
| 6 | -T3171:
|
|
| 7 | - echo "do Control.Concurrent.threadDelay 3000000; putStrLn \"threadDelay was not interrupted\"" | \
|
|
| 8 | - "$(TEST_HC)" $(TEST_HC_OPTS_INTERACTIVE) & \
|
|
| 9 | - sleep 2; kill -INT $$!; wait
|
|
| 6 | +# Wait for the statement to start before interrupting (#15383), and signal
|
|
| 7 | +# the external interpreter too (the `pgrep -P $!`), as ^C in a terminal would.
|
|
| 8 | +#
|
|
| 9 | +# The ext interp tests both:
|
|
| 10 | +# - interrupting a remote request doesn't terminate the ext interpreter (#18852)
|
|
| 11 | +# - a ^C gets propagated to the thread evaluating the user request on the ext
|
|
| 12 | +# interpreter so that it gets interrupted
|
|
| 13 | +T3171ext: T3171_OPTS = -fexternal-interpreter
|
|
| 14 | +T3171 T3171ext:
|
|
| 15 | + rm -f $@.started
|
|
| 16 | + echo 'do { writeFile "$@.started" ""; Control.Concurrent.threadDelay 100000000 `Control.Exception.onException` System.IO.hPutStrLn System.IO.stderr "threadDelay was interrupted"; putStrLn "threadDelay was not interrupted" }' | \
|
|
| 17 | + "$(TEST_HC)" $(TEST_HC_OPTS_INTERACTIVE) $(T3171_OPTS) & \
|
|
| 18 | + while [ ! -e $@.started ] && kill -0 $$! 2>/dev/null; do sleep 0.1; done; \
|
|
| 19 | + kill -INT $$! $$(pgrep -P $$!); wait
|
|
| 10 | 20 | |
| 11 | 21 | TopEnvIface:
|
| 12 | 22 | "$(TEST_HC)" $(TEST_HC_OPTS_INTERACTIVE) TopEnvIface -v1 -fno-hide-source-paths -e "a" -e ":q" -fwrite-if-simplified-core -fwrite-interface
|
| 1 | +threadDelay was interrupted
|
|
| 1 | 2 | Interrupted. |
| 1 | +threadDelay was interrupted
|
|
| 2 | +Interrupted. |
| ... | ... | @@ -12,11 +12,17 @@ test('T27287', [just_ghci, combined_output], makefile_test, []) |
| 12 | 12 | |
| 13 | 13 | test('T3171',
|
| 14 | 14 | [when(opsys('mingw32'),skip),
|
| 15 | - fragile(15383),
|
|
| 16 | 15 | req_interp,
|
| 17 | 16 | combined_output],
|
| 18 | 17 | makefile_test, [])
|
| 19 | 18 | |
| 19 | +test('T3171ext',
|
|
| 20 | + [when(opsys('mingw32'),skip),
|
|
| 21 | + req_interp,
|
|
| 22 | + unless(config.have_ext_interp, skip),
|
|
| 23 | + combined_output],
|
|
| 24 | + makefile_test, [])
|
|
| 25 | + |
|
| 20 | 26 | test('ghcirun004', just_ghci, compile_and_run, [''])
|
| 21 | 27 | test('T8377', just_ghci, compile_and_run, [''])
|
| 22 | 28 | test('T9914', just_ghci, ghci_script, ['T9914.script'])
|