Skip to content

Commit 251d8da

Browse files
committed
Test drive timeouts on different function
1 parent 2be5263 commit 251d8da

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/testthat/test-retry.R

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,16 @@ test_with_dir("retries", {
4343
test_with_dir("timouts", {
4444
scenario <- get_testing_scenario()
4545
e <- eval(parse(text = scenario$envir))
46-
pl <- data.frame(target = "x", command = "Sys.sleep(0.25)")
46+
# From R.utils examples and tests
47+
foo <- function() {
48+
print("Tic")
49+
for (kk in 1:20) {
50+
print(kk)
51+
Sys.sleep(0.1)
52+
}
53+
print("Tac")
54+
}
55+
pl <- data.frame(target = "x", command = "foo()")
4756
expect_error(
4857
tmp <- capture.output(capture.output(
4958
make(
@@ -53,6 +62,7 @@ test_with_dir("timouts", {
5362
timeout = 1e-3
5463
), type = "message"), type = "output")
5564
)
65+
expect_false(cached(x))
5666
expect_error(
5767
tmp <- capture.output(capture.output(
5868
make(
@@ -63,6 +73,7 @@ test_with_dir("timouts", {
6373
retries = 2
6474
), type = "message"), type = "output")
6575
)
76+
expect_false(cached(x))
6677
pl <- workflow(x = 1 + 1)
6778
expect_silent(
6879
tmp <- capture.output(make(

0 commit comments

Comments
 (0)