Skip to content

Commit 3b9940b

Browse files
Make package tests work with future 1.14.0-9000
1 parent 08fc3e6 commit 3b9940b

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Package: future.batchtools
22
Version: 0.8.0-9000
33
Depends:
44
R (>= 3.2.0),
5-
future (>= 1.12.0)
5+
future (>= 1.14.0)
66
Imports:
77
batchtools (>= 0.9.11)
88
Suggests:

NEWS

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
Package: future.batchtools
22
==========================
33

4-
Version: 0.8.0-9000 [2019-06-22]
4+
Version: 0.8.0-9000 [2019-09-27]
55

6-
* ...
7-
86
BUG FIXES:
97

108
* print() for BatchtoolsFuture would produce an error if the underlying

tests/BatchtoolsFuture.R

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@ message("*** BatchtoolsFuture() - cleanup ... DONE")
1414

1515
message("*** BatchtoolsFuture() - deleting exceptions ...")
1616

17-
## Deleting a non-resolved future
18-
f <- BatchtoolsFuture({ x <- 1 })
19-
res <- tryCatch({
20-
delete(f)
21-
}, warning = function(w) w)
22-
print(res)
23-
stopifnot(inherits(res, "warning"))
24-
2517
## Printing a deleted future
2618
f <- batchtools_local(42L)
2719
print(f)

tests/future,lazy.R

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ for (strategy in strategies) {
1515
a <- 42
1616
f <- future(2 * a, lazy = TRUE)
1717
a <- 21
18-
stopifnot(!resolved(f))
18+
## In future (> 1.14.0), resolved() will launch lazy future,
19+
## which means for some backends (e.g. sequential) this means
20+
## that resolved() might end up returning TRUE.
21+
if (packageVersion("future") <= "1.14.0") {
22+
stopifnot(!resolved(f))
23+
}
1924
f <- resolve(f)
2025
stopifnot(resolved(f))
2126
v <- value(f)
@@ -25,7 +30,12 @@ for (strategy in strategies) {
2530
v %<-% { 2 * a } %lazy% TRUE
2631
a <- 21
2732
f <- futureOf(v)
28-
stopifnot(!resolved(f))
33+
## In future (> 1.14.0), resolved() will launch lazy future,
34+
## which means for some backends (e.g. sequential) this means
35+
## that resolved() might end up returning TRUE.
36+
if (packageVersion("future") <= "1.14.0") {
37+
stopifnot(!resolved(f))
38+
}
2939
f <- resolve(f)
3040
stopifnot(resolved(f))
3141
stopifnot(v == 84)

0 commit comments

Comments
 (0)