Skip to content

Commit 4a6dd9e

Browse files
TESTS: Add test for future interrupting itself; some backends ignore it
1 parent 50a617b commit 4a6dd9e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/interrupts.R

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
source("incl/start.R")
2+
options(future.debug = FALSE)
3+
4+
for (strategy in supportedStrategies()) {
5+
message(sprintf("- plan('%s') ...", strategy))
6+
plan(strategy)
7+
8+
f <- future({
9+
message("Hello world!")
10+
cat("Hi there\n")
11+
tools::pskill(Sys.getpid(), signal = tools::SIGINT)
12+
42
13+
})
14+
r <- result(f)
15+
v <- value(f)
16+
print(v)
17+
18+
## Interruptiing the evaluation of itself is not supported
19+
## on all backends
20+
stopifnot(is.null(v) || v == 42)
21+
}
22+
23+
source("incl/end.R")

0 commit comments

Comments
 (0)