Running 'BatchtoolsFuture,gc.R' [6s]
  Running 'BatchtoolsFuture.R' [6s]
  Running 'BatchtoolsFutureError.R' [13s]
  Running 'batchtools_custom.R' [14s]
  Running 'batchtools_hpc.R' [2s]
  Running 'batchtools_interactive.R' [4s]
  Running 'batchtools_local.R' [12s]
  Running 'batchtools_multicore.R' [19s]
  Running 'batchtools_template.R' [2s]
  Running 'demo.R' [11s]
  Running 'dotdotdot.R' [11s]
  Running 'future,labels.R' [14s]
  Running 'future,lazy.R' [6s]
  Running 'globals,formulas.R' [23s]
  Running 'globals,manual.R' [17s]
  Running 'globals,subassignment.R' [17s]
  Running 'globals,tricky.R' [19s]
  Running 'nbrOfWorkers.R' [2s]
  Running 'plan.R' [7s]
  Running 'resources_OP.R' [4s]
  Running 'stdout.R' [13s]
  Running 'utils.R' [2s]
  Running 'zzz,future_lapply.R' [36s]
  Running 'zzz.onUnload.R' [2s]
Running the tests in 'tests/batchtools_interactive.R' failed.
Complete output:
  > source("incl/start.R")
  Loading required package: future
  > library("listenv")
  > 
  > message("*** batchtools_interactive() ...")
  *** batchtools_interactive() ...
  > 
  > message("*** batchtools_interactive() without globals")
  *** batchtools_interactive() without globals
  > 
  > f <- batchtools_interactive({
  +   42L
  + })
  > stopifnot(inherits(f, "BatchtoolsFuture"))
  > 
  > ## Check whether a batchtools_interactive future is resolved
  > ## or not will force evaluation
  > print(is_resolved <- resolved(f))
  [1] TRUE
  > stopifnot(is_resolved)
  > 
  > y <- value(f)
  > print(y)
  [1] 42
  > stopifnot(y == 42L)
  > 
  > 
  > message("*** batchtools_interactive() with globals")
  *** batchtools_interactive() with globals
  > ## A global variable
  > a <- 0
  > f <- batchtools_interactive({
  +   b <- 3
  +   c <- 2
  +   a * b * c
  + })
  > 
  > ## Although 'f' is a batchtools_interactive future and therefore
  > ## resolved/evaluates the future expression only
  > ## when the value is requested, any global variables
  > ## identified in the expression (here 'a') are
  > ## "frozen" at the time point when the future is
  > ## created.  Because of this, 'a' preserved the
  > ## zero value although we reassign it below
  > a <- 7  ## Make sure globals are frozen
  > v <- value(f)
  > print(v)
  [1] 0
  > stopifnot(v == 0)
  > 
  > 
  > message("*** batchtools_interactive() with globals (tricky)")
  *** batchtools_interactive() with globals (tricky)
  > x <- listenv()
  > for (ii in 1:2) x[[ii]] <- batchtools_interactive({ ii }, globals = TRUE)
  > v <- unlist(value(x))
  > stopifnot(all(v == 1:2))  ## Make sure globals are frozen
  > 
  > 
  > message("*** batchtools_interactive() and errors")
  *** batchtools_interactive() and errors
  > f <- batchtools_interactive({
  +   stop("Whoops!")
  +   1
  + })
  > v <- value(f, signal = FALSE)
  Warning in delete.BatchtoolsFuture(future) :
    Will not remove batchtools registry, because the status of the batchtools was 'error', 'defined', 'finished', 'started', 'submitted' and option 'future.delete' is FALSE or running in an interactive session: 'D:/temp/RtmpAZ7PAO/.future/20221202_201920-AZ7PAO/batchtools_1662725671'
  > print(v)
  <simpleError in eval(quote({    stop("Whoops!")    1}), new.env()): Whoops!>
  > stopifnot(inherits(v, "simpleError"))
  > 
  > res <- try({ v <- value(f) }, silent = TRUE)
  > print(res)
  [1] "Error in eval(quote({ : Whoops!\n"
  attr(,"class")
  [1] "try-error"
  attr(,"condition")
  <simpleError in eval(quote({    stop("Whoops!")    1}), new.env()): Whoops!>
  > stopifnot(inherits(res, "try-error"))
  > 
  > ## Error is repeated
  > res <- try(value(f), silent = TRUE)
  > print(res)
  [1] "Error in eval(quote({ : Whoops!\n"
  attr(,"class")
  [1] "try-error"
  attr(,"condition")
  <simpleError in eval(quote({    stop("Whoops!")    1}), new.env()): Whoops!>
  > stopifnot(inherits(res, "try-error"))
  > 
  > message("*** batchtools_interactive() ... DONE")
  *** batchtools_interactive() ... DONE
  > 
  > source("incl/end.R")
  Error: identical(Sys.getenv(), oenvs0) is not TRUE
  Execution halted
  Warning message:
  In delete.BatchtoolsFuture(f, onRunning = "skip", onMissing = "ignore",  :
    Will not remove batchtools registry, because the status of the batchtools was 'error', 'defined', 'finished', 'started', 'submitted' and option 'future.delete' is FALSE or running in an interactive session: 'D:/temp/RtmpAZ7PAO/.future/20221202_201920-AZ7PAO/batchtools_1662725671'
Running the tests in 'tests/dotdotdot.R' failed.
Complete output:
  > source("incl/start.R")
  Loading required package: future
  > library("listenv")
  > 
  > strategies <- c("batchtools_interactive", "batchtools_local")
  > 
  > ## CRAN processing times:
  > ## On Windows 32-bit, don't run these tests
  > if (!fullTest && isWin32) strategies <- character(0L)
  > 
  > 
  > message("*** Global argument '...' in futures ...")
  *** Global argument '...' in futures ...
  > 
  > sum_fcns <- list()
  > 
  > sum_fcns$A <- function(x, ...) {
  +   message("Arguments '...' exists: ", exists("...", inherits = TRUE))
  +   y %<-% { sum(x, ...) }
  +   y
  + }
  > 
  > 
  > sum_fcns$B <- function(x, ...) {
  +   sumt <- function(x) {
  +     message("Arguments '...' exists: ", exists("...", inherits = TRUE))
  +     y %<-% { sum(x, ...) }
  +     y
  +   }
  +   sumt(x)
  + }
  > 
  > sum_fcns$C <- function(x, y) {
  +   message("Arguments '...' exists: ", exists("...", inherits = TRUE))
  +   y %<-% { sum(x, y) }
  +   y
  + }
  > 
  > sum_fcns$D <- function(x, y) {
  +   message("Arguments '...' exists: ", exists("...", inherits = TRUE))
  +   y %<-% { sum(x, y, ...) }
  +   y
  + }
  > 
  > 
  > for (strategy in strategies) {
  +   plan(strategy, substitute = FALSE)
  + 
  +   for (name in names(sum_fcns)) {
  +     mprintf("** Sum function '%s' with plan('%s') ...\n", name, strategy)
  +     sum_fcn <- sum_fcns[[name]]
  +     print(sum_fcn)
  +     y <- try(sum_fcn(1:2, 3))
  +     print(y)
  +     if (name %in% c("D")) {
  +       stopifnot(inherits(y, "try-error"))
  +     } else {
  +       stopifnot(y == 6)
  +     }
  +   }
  + }
  ** Sum function 'A' with plan('batchtools_interactive') ...
  function (x, ...) 
  {
      message("Arguments '...' exists: ", exists("...", inherits = TRUE))
      y %<-% {
          sum(x, ...)
      }
      y
  }
  Arguments '...' exists: TRUE
  [1] 6
  ** Sum function 'B' with plan('batchtools_interactive') ...
  function (x, ...) 
  {
      sumt <- function(x) {
          message("Arguments '...' exists: ", exists("...", inherits = TRUE))
          y %<-% {
              sum(x, ...)
          }
          y
      }
      sumt(x)
  }
  Arguments '...' exists: TRUE
  [1] 6
  ** Sum function 'C' with plan('batchtools_interactive') ...
  function (x, y) 
  {
      message("Arguments '...' exists: ", exists("...", inherits = TRUE))
      y %<-% {
          sum(x, y)
      }
      y
  }
  Arguments '...' exists: FALSE
  [1] 6
  ** Sum function 'D' with plan('batchtools_interactive') ...
  function (x, y) 
  {
      message("Arguments '...' exists: ", exists("...", inherits = TRUE))
      y %<-% {
          sum(x, y, ...)
      }
      y
  }
  Arguments '...' exists: FALSE
  Warning in delete.BatchtoolsFuture(future) :
    Will not remove batchtools registry, because the status of the batchtools was 'error', 'defined', 'finished', 'started', 'submitted' and option 'future.delete' is FALSE or running in an interactive session: 'D:/temp/Rtmp8ySKcB/.future/20221202_202008-8ySKcB/batchtools_1386246581'
  Error in eval(quote({ : '...' used in an incorrect context
  [1] "Error in eval(quote({ : '...' used in an incorrect context\n"
  attr(,"class")
  [1] "try-error"
  attr(,"condition")
  <simpleError in eval(quote({    sum(x, y, ...)}), new.env()): '...' used in an incorrect context>
  ** Sum function 'A' with plan('batchtools_local') ...
  function (x, ...) 
  {
      message("Arguments '...' exists: ", exists("...", inherits = TRUE))
      y %<-% {
          sum(x, ...)
      }
      y
  }
  Arguments '...' exists: TRUE
  [1] 6
  ** Sum function 'B' with plan('batchtools_local') ...
  function (x, ...) 
  {
      sumt <- function(x) {
          message("Arguments '...' exists: ", exists("...", inherits = TRUE))
          y %<-% {
              sum(x, ...)
          }
          y
      }
      sumt(x)
  }
  Arguments '...' exists: TRUE
  [1] 6
  ** Sum function 'C' with plan('batchtools_local') ...
  function (x, y) 
  {
      message("Arguments '...' exists: ", exists("...", inherits = TRUE))
      y %<-% {
          sum(x, y)
      }
      y
  }
  Arguments '...' exists: FALSE
  [1] 6
  ** Sum function 'D' with plan('batchtools_local') ...
  function (x, y) 
  {
      message("Arguments '...' exists: ", exists("...", inherits = TRUE))
      y %<-% {
          sum(x, y, ...)
      }
      y
  }
  Arguments '...' exists: FALSE
  Warning in delete.BatchtoolsFuture(future) :
    Will not remove batchtools registry, because the status of the batchtools was 'error', 'defined', 'finished', 'started', 'submitted' and option 'future.delete' is FALSE or running in an interactive session: 'D:/temp/Rtmp8ySKcB/.future/20221202_202008-8ySKcB/batchtools_1426380627'
  Error in eval(quote({ : '...' used in an incorrect context
  [1] "Error in eval(quote({ : '...' used in an incorrect context\n"
  attr(,"class")
  [1] "try-error"
  attr(,"condition")
  <simpleError in eval(quote({    sum(x, y, ...)}), new.env()): '...' used in an incorrect context>
  > 
  > message("*** Global argument '...' in futures ... DONE")
  *** Global argument '...' in futures ... DONE
  > 
  > source("incl/end.R")
  Error: identical(Sys.getenv(), oenvs0) is not TRUE
  Execution halted
  Warning messages:
  1: In delete.BatchtoolsFuture(f, onRunning = "skip", onMissing = "ignore",  :
    Will not remove batchtools registry, because the status of the batchtools was 'error', 'defined', 'finished', 'started', 'submitted' and option 'future.delete' is FALSE or running in an interactive session: 'D:/temp/Rtmp8ySKcB/.future/20221202_202008-8ySKcB/batchtools_1426380627'
  2: In delete.BatchtoolsFuture(f, onRunning = "skip", onMissing = "ignore",  :
    Will not remove batchtools registry, because the status of the batchtools was 'error', 'defined', 'finished', 'started', 'submitted' and option 'future.delete' is FALSE or running in an interactive session: 'D:/temp/Rtmp8ySKcB/.future/20221202_202008-8ySKcB/batchtools_1386246581'
Running the tests in 'tests/plan.R' failed.
Complete output:
  > source("incl/start,load-only.R")
  > 
  > message("*** plan() ...")
  *** plan() ...
  > 
  > message("*** future::plan(future.batchtools::batchtools_local)")
  *** future::plan(future.batchtools::batchtools_local)
  > oplan <- future::plan(future.batchtools::batchtools_local)
  > print(future::plan())
  batchtools_local:
  - args: function (expr, envir = parent.frame(), substitute = TRUE, globals = TRUE, label = NULL, workers = 1L, registry = list(), ...)
  - tweaked: FALSE
  - call: future::plan(future.batchtools::batchtools_local)
  > future::plan(oplan)
  > print(future::plan())
  batchtools_local:
  - args: function (expr, envir = parent.frame(), substitute = TRUE, globals = TRUE, label = NULL, workers = 1L, registry = list(), ...)
  - tweaked: FALSE
  - call: future::plan(future.batchtools::batchtools_local)
  > 
  > 
  > library("future.batchtools")
  Loading required package: future
  > 
  > for (type in c("batchtools_interactive", "batchtools_local")) {
  +   mprintf("*** plan('%s') ...\n", type)
  + 
  +   plan(type)
  +   stopifnot(inherits(plan("next"), "batchtools"))
  + 
  +   a <- 0
  +   f <- future({
  +     b <- 3
  +     c <- 2
  +     a * b * c
  +   })
  +   a <- 7  ## Make sure globals are frozen
  +   v <- value(f)
  +   print(v)
  +   stopifnot(v == 0)
  + 
  + 
  +   ## Customize the 'work.dir' of the batchtools registries
  +   normalize_path <- function(path) {
  +     if (!utils::file_test("-d", path)) stop("No such path: ", path)
  +     opwd <- getwd()
  +     on.exit(setwd(opwd))
  +     setwd(normalizePath(path))
  +     getwd()
  +   }
  +   plan(type, registry = list(work.dir = NULL))
  +   f <- future(42, lazy = TRUE)
  +   ## In future releases, lazy futures may stay vanilla Future objects
  +   if (inherits(f, "BatchtoolsFuture")) {
  +     if (!is.null(f$config$reg)) {
  +       utils::str(list(
  +         normalize_path(f$config$reg$work.dir),
  +         getwd = getwd()
  +       ))
  +       stopifnot(normalize_path(f$config$reg$work.dir) == getwd())
  +     }
  +   }
  + 
  +   path <- tempdir()
  +   plan(type, registry = list(work.dir = path))
  +   f <- future(42, lazy = TRUE)
  +   ## In future releases, lazy futures may stay vanilla Future objects
  +   if (inherits(f, "BatchtoolsFuture")) {
  +     if (!is.null(f$config$reg)) {
  +       utils::str(list(
  +         normalize_path(f$config$reg$work.dir),
  +         path = normalize_path(path)
  +       ))
  +       stopifnot(normalize_path(f$config$reg$work.dir) == normalize_path(path))
  +     }
  +   }
  + 
  +   mprintf("*** plan('%s') ... DONE\n", type)
  + } # for (type ...)
  *** plan('batchtools_interactive') ...
  [1] 0
  *** plan('batchtools_interactive') ... DONE
  *** plan('batchtools_local') ...
  [1] 0
  *** plan('batchtools_local') ... DONE
  > 
  > 
  > message("*** Assert that default backend can be overridden ...")
  *** Assert that default backend can be overridden ...
  > 
  > mpid <- Sys.getpid()
  > print(mpid)
  [1] 87864
  > 
  > plan(batchtools_interactive)
  > pid %<-% { Sys.getpid() }
  > print(pid)
  [1] 87864
  > stopifnot(pid == mpid)
  > 
  > plan(batchtools_local)
  > pid %<-% { Sys.getpid() }
  > print(pid)
  [1] 113604
  > stopifnot(pid != mpid)
  > 
  > 
  > message("*** plan() ... DONE")
  *** plan() ... DONE
  > 
  > source("incl/end.R")
  Error: identical(Sys.getenv(), oenvs0) is not TRUE
  Execution halted