Running 'BatchtoolsFuture,gc.R' [2s]
  Running 'BatchtoolsFuture.R' [2s]
  Running 'BatchtoolsFutureError.R' [2s]
  Running 'batchtools_custom.R' [1s]
  Running 'batchtools_hpc.R' [1s]
  Running 'batchtools_interactive.R' [2s]
  Running 'batchtools_local.R' [2s]
  Running 'batchtools_multicore.R' [2s]
  Running 'batchtools_template.R' [2s]
  Running 'demo.R' [2s]
  Running 'dotdotdot.R' [3s]
  Running 'future,labels.R' [2s]
  Running 'future,lazy.R' [2s]
  Running 'globals,formulas.R' [1s]
  Running 'globals,manual.R' [2s]
  Running 'globals,subassignment.R' [2s]
  Running 'globals,tricky.R' [1s]
  Running 'nbrOfWorkers.R' [1s]
  Running 'plan.R' [2s]
  Running 'resources_OP.R' [2s]
  Running 'utils.R' [1s]
  Running 'zzz,future_lapply.R' [2s]
  Running 'zzz.onUnload.R' [1s]
Running the tests in 'tests/BatchtoolsFuture,gc.R' failed.
Complete output:
  > source("incl/start.R")
  Loading required package: future
  plan(): nbrOfWorkers() = 1
  > 
  > message("*** BatchtoolsFuture() and garbage collection ...")
  *** BatchtoolsFuture() and garbage collection ...
  > 
  > plan(batchtools_local)
  plan(): nbrOfWorkers() = 1
  > 
  > for (how in c("resolve", "value")) {
  +   f <- future({ 1 })
  +   print(f)
  + 
  +   if (how == "value") {
  +     v <- value(f)
  +     print(v)
  +   } else if (how == "resolve") {
  +     resolve(f)
  +   }
  + 
  +   stopifnot(resolved(f))
  + 
  +   reg <- f$config$reg
  + 
  +   ## Force removal of batchtools registry files
  +   rm(list = "f")
  +   gc()
  + 
  +   ## Assert removal of files only happens if there was not
  +   ## a failure and option future.delete is not TRUE.
  +   stopifnot(!file_test("-d", reg$file.dir))
  +   fail <- try(checkIds(reg, ids = 1L), silent = TRUE)
  +   stopifnot(inherits(fail, "try-error"))
  + } ## for (how ...)
  getGlobalsAndPackages() ...
  Searching for globals ...
  - globals found: [1] '{'
  Searching for globals ... DONE
  Resolving globals: FALSE
  
  
  getGlobalsAndPackages() ... DONE
  Error: [ENOENT] Failed to realize 'C:/Users/CRAN/.batchtools.conf.R': no such file or directory
  Execution halted
Running the tests in 'tests/BatchtoolsFuture.R' failed.
Complete output:
  > source("incl/start.R")
  Loading required package: future
  plan(): nbrOfWorkers() = 1
  > 
  > message("*** BatchtoolsFuture() ...")
  *** BatchtoolsFuture() ...
  > 
  > message("*** BatchtoolsFuture() - cleanup ...")
  *** BatchtoolsFuture() - cleanup ...
  > 
  > f <- batchtools_local({ 1L })
  getGlobalsAndPackages() ...
  Searching for globals ...
  - globals found: [1] '{'
  Searching for globals ... DONE
  Resolving globals: FALSE
  
  
  getGlobalsAndPackages() ... DONE
  Error: [ENOENT] Failed to realize 'C:/Users/CRAN/.batchtools.conf.R': no such file or directory
  Execution halted
Running the tests in 'tests/BatchtoolsFutureError.R' failed.
Complete output:
  > source("incl/start.R")
  Loading required package: future
  plan(): nbrOfWorkers() = 1
  > 
  > message("*** BatchtoolsFutureError() ...")
  *** BatchtoolsFutureError() ...
  > 
  > plan(batchtools_local)
  plan(): nbrOfWorkers() = 1
  > 
  > for (cleanup in c(FALSE, TRUE)) {
  +   mprintf("*** batchtools future error w/ future.delete = %s ...", cleanup)
  + 
  +   options(future.delete = cleanup)
  + 
  +   f <- future({
  +     x <- 1
  +     print(x)
  +     stop("Woops!")
  +   })
  +   print(f)
  + 
  +   resolve(f)
  +   
  +   ## Assert future is listed as resolved
  +   stopifnot(resolved(f))
  + 
  +   reg <- f$config$reg
  +   ## Force garbage collection of future which will possibly
  +   ## result in the removal of batchtools registry files
  + 
  +   reg.finalizer(f, function(f) {
  +     message("Garbage collection future ...")
  +     print(f)
  +     message("Garbage collection future ... DONE")
  +   }, onexit = TRUE)
  +   rm(list = "f")
  +   gc()
  +   message(" - Future removed and garbage collected.")
  +   mprintf(" - batchtools Registry path (%s) exists: %s\n",
  +           sQuote(reg$file.dir), file_test("-d", reg$file.dir))
  +   
  +   ## Assert removal of files only happens if there was not
  +   ## a failure and option future.delete is not TRUE.
  +   if (!cleanup) {
  +     ## FIXME: Does the new future::FutureResult trigger garbage collection?
  +     stopifnot(file_test("-d", reg$file.dir))
  +     log <- batchtools::getLog(reg = reg, id = 1L)
  +     print(log)
  + 
  +     ## Now manually delete batchtools Registry
  +     batchtools::removeRegistry(reg = reg)
  +   }
  + 
  +   stopifnot(!file_test("-d", reg$file.dir))
  +   fail <- try(checkIds(reg, ids = 1L), silent = TRUE)
  +   stopifnot(inherits(fail, "try-error"))
  + 
  +   mprintf("*** batchtools future error w/ future.delete = %s ... DONE", cleanup)
  + } ## for (cleanup ...)
  *** batchtools future error w/ future.delete = FALSE ...getGlobalsAndPackages() ...
  Searching for globals ...
  - globals found: [4] '{', '<-', 'print', 'stop'
  Searching for globals ... DONE
  Resolving globals: FALSE
  
  
  getGlobalsAndPackages() ... DONE
  Error: [ENOENT] Failed to realize 'C:/Users/CRAN/.batchtools.conf.R': no such file or directory
  Execution halted
Running the tests in 'tests/batchtools_custom.R' failed.
Complete output:
  > source("incl/start.R")
  Loading required package: future
  plan(): nbrOfWorkers() = 1
  > library("batchtools")
  Loading required package: data.table
  > library("listenv")
  > 
  > message("*** batchtools_custom() ...")
  *** batchtools_custom() ...
  > 
  > cf <- makeClusterFunctionsInteractive(external = TRUE)
  > str(cf)
  List of 11
   $ name                : chr "Interactive"
   $ submitJob           :function (reg, jc)  
   $ killJob             : NULL
   $ listJobsQueued      : NULL
   $ listJobsRunning     : NULL
   $ array.var           : chr NA
   $ store.job.collection: logi TRUE
   $ store.job.files     : logi FALSE
   $ scheduler.latency   : num 0
   $ fs.latency          : num NA
   $ hooks               : list()
   - attr(*, "class")= chr "ClusterFunctions"
  > 
  > 
  > message("*** batchtools_custom() ...")
  *** batchtools_custom() ...
  > 
  > message("*** batchtools_custom() without globals")
  *** batchtools_custom() without globals
  > 
  > f <- batchtools_custom({
  +   42L
  + }, cluster.functions = cf)
  getGlobalsAndPackages() ...
  Searching for globals ...
  - globals found: [1] '{'
  Searching for globals ... DONE
  Resolving globals: FALSE
  
  
  getGlobalsAndPackages() ... DONE
  Error: [ENOENT] Failed to realize 'C:/Users/CRAN/.batchtools.conf.R': no such file or directory
  Execution halted
Running the tests in 'tests/batchtools_interactive.R' failed.
Complete output:
  > source("incl/start.R")
  Loading required package: future
  plan(): nbrOfWorkers() = 1
  > library("listenv")
  > 
  > message("*** batchtools_interactive() ...")
  *** batchtools_interactive() ...
  > 
  > message("*** batchtools_interactive() without globals")
  *** batchtools_interactive() without globals
  > 
  > f <- batchtools_interactive({
  +   42L
  + })
  getGlobalsAndPackages() ...
  Searching for globals ...
  - globals found: [1] '{'
  Searching for globals ... DONE
  Resolving globals: FALSE
  
  
  getGlobalsAndPackages() ... DONE
  Error: [ENOENT] Failed to realize 'C:/Users/CRAN/.batchtools.conf.R': no such file or directory
  Execution halted
Running the tests in 'tests/batchtools_local.R' failed.
Complete output:
  > source("incl/start.R")
  Loading required package: future
  plan(): nbrOfWorkers() = 1
  > library("listenv")
  > 
  > message("*** batchtools_local() ...")
  *** batchtools_local() ...
  > 
  > message("*** batchtools_local() without globals")
  *** batchtools_local() without globals
  > 
  > f <- batchtools_local({
  +   42L
  + })
  getGlobalsAndPackages() ...
  Searching for globals ...
  - globals found: [1] '{'
  Searching for globals ... DONE
  Resolving globals: FALSE
  
  
  getGlobalsAndPackages() ... DONE
  Error: [ENOENT] Failed to realize 'C:/Users/CRAN/.batchtools.conf.R': no such file or directory
  Execution halted
Running the tests in 'tests/batchtools_multicore.R' failed.
Complete output:
  > source("incl/start.R")
  Loading required package: future
  plan(): nbrOfWorkers() = 1
  > library("listenv")
  > 
  > 
  > message("*** batchtools_multicore() ...")
  *** batchtools_multicore() ...
  > 
  > for (cores in 1:min(3L, availableCores("multicore"))) {
  +   ## FIXME:
  +   if (!fullTest && cores > 1) next
  + 
  +   mprintf("Testing with %d cores ...", cores)
  +   options(mc.cores = cores - 1L)
  + 
  +   if (!supportsMulticore()) {
  +     mprintf("batchtools multicore futures are not supporting on '%s'. Falling back to use synchroneous batchtools local futures", .Platform$OS.type) #nolint
  +   }
  + 
  +   for (globals in c(FALSE, TRUE)) {
  +     mprintf("*** batchtools_multicore(..., globals = %s) without globals",
  +             globals)
  + 
  +     f <- batchtools_multicore({
  +       42L
  +     }, globals = globals)
  +     stopifnot(
  +       inherits(f, "BatchtoolsFuture") ||
  +       ((cores == 1 || !supportsMulticore()) && inherits(f, "EagerFuture"))
  +     )
  + 
  +     print(resolved(f))
  +     y <- value(f)
  +     print(y)
  +     stopifnot(y == 42L)
  + 
  +     mprintf("*** batchtools_multicore(..., globals = %s) with globals",
  +           globals)
  +     ## A global variable
  +     a <- 0
  +     f <- batchtools_multicore({
  +       b <- 3
  +       c <- 2
  +       a * b * c
  +     }, globals = globals)
  +     print(f)
  + 
  + 
  +     ## A multicore future is evaluated in a separated
  +     ## forked process.  Changing the value of a global
  +     ## variable should not affect the result of the
  +     ## future.
  +     a <- 7  ## Make sure globals are frozen
  +     if (globals || f$config$reg$cluster.functions$name == "Multicore") {
  +       v <- value(f)
  +       print(v)
  +       stopifnot(v == 0)
  +     } else {
  +       res <- tryCatch({ value(f) }, error = identity)
  +       print(res)
  +       stopifnot(inherits(res, "simpleError"))
  +     }
  + 
  + 
  +     mprintf("*** batchtools_multicore(..., globals = %s) with globals and blocking", globals) #nolint
  +     x <- listenv()
  +     for (ii in 1:4) {
  +       mprintf(" - Creating batchtools_multicore future #%d ...", ii)
  +       x[[ii]] <- batchtools_multicore({ ii }, globals = globals)
  +     }
  +     mprintf(" - Resolving %d batchtools_multicore futures", length(x))
  +     if (globals || f$config$reg$cluster.functions$name == "Multicore") {
  +       v <- sapply(x, FUN = value)
  +       stopifnot(all(v == 1:4))
  +     } else {
  +       v <- lapply(x, FUN = function(f) tryCatch(value(f), error = identity))
  +       stopifnot(all(sapply(v, FUN = inherits, "simpleError")))
  +     }
  + 
  +     mprintf("*** batchtools_multicore(..., globals = %s) and errors", globals)
  +     f <- batchtools_multicore({
  +       stop("Whoops!")
  +       1
  +     }, globals = globals)
  +     print(f)
  +     v <- value(f, signal = FALSE)
  +     print(v)
  +     stopifnot(inherits(v, "simpleError"))
  + 
  +     res <- try(value(f), silent = TRUE)
  +     print(res)
  +     stopifnot(inherits(res, "try-error"))
  + 
  +     ## Error is repeated
  +     res <- try(value(f), silent = TRUE)
  +     print(res)
  +     stopifnot(inherits(res, "try-error"))
  + 
  +   } # for (globals ...)
  + 
  + 
  +   message("*** batchtools_multicore(..., workers = 1L) ...")
  + 
  +   a <- 2
  +   b <- 3
  +   y_truth <- a * b
  + 
  +   f <- batchtools_multicore({ a * b }, workers = 1L)
  +   rm(list = c("a", "b"))
  + 
  +   v <- value(f)
  +   print(v)
  +   stopifnot(v == y_truth)
  + 
  +   message("*** batchtools_multicore(..., workers = 1L) ... DONE")
  + 
  +   mprintf("Testing with %d cores ... DONE", cores)
  + } ## for (cores ...)
  Testing with 1 cores ...batchtools multicore futures are not supporting on 'windows'. Falling back to use synchroneous batchtools local futures*** batchtools_multicore(..., globals = FALSE) without globalsError: [ENOENT] Failed to realize 'C:/Users/CRAN/.batchtools.conf.R': no such file or directory
  Execution halted
Running the tests in 'tests/demo.R' failed.
Complete output:
  > source("incl/start.R")
  Loading required package: future
  plan(): nbrOfWorkers() = 1
  > 
  > options("R_FUTURE_DEMO_MANDELBROT_PLANES" = 4L)
  > 
  > message("*** Demos ...")
  *** Demos ...
  > 
  > message("*** Mandelbrot demo of the 'future' package ...")
  *** Mandelbrot demo of the 'future' package ...
  > 
  > plan(batchtools_local)
  plan(): nbrOfWorkers() = 1
  > demo("mandelbrot", package = "future", ask = FALSE)
  
  
  	demo(mandelbrot)
  	---- ~~~~~~~~~~
  
  > library("future")
  
  > library("graphics")
  
  > plot_what_is_done <- function(counts) {
  +   for (kk in seq_along(counts)) {
  +     f <- counts[[kk]]
  + 
  +     ## Already plotted?
  +     if (!inherits(f, "Future")) next
  + 
  +     ## Not resolved?
  +     if (!resolved(f)) next
  + 
  +     cat(sprintf("Plotting tile #%d of %d ...\n", kk, n))
  +     counts[[kk]] <- value(counts[[kk]])
  +     screen(kk)
  +     plot(counts[[kk]])
  +   }
  + 
  +   counts
  + }
  
  > ## Options
  > region <- getOption("future.demo.mandelbrot.region", 1L)
  
  > if (!is.list(region)) {
  +   if (region == 1L) {
  +     region <- list(xmid = -0.75, ymid = 0.0, side = 3.0)
  +   } else if (region == 2L) {
  +     region <- list(xmid = 0.283, ymid = -0.0095, side = 0.00026)
  +   } else if (region == 3L) {
  +     region <- list(xmid = 0.282989, ymid = -0.01, side = 3e-8)
  +   }
  + }
  
  > nrow <- getOption("future.demo.mandelbrot.nrow", 3L)
  
  > resolution <- getOption("future.demo.mandelbrot.resolution", 400L)
  
  > delay <- getOption("future.demo.mandelbrot.delay", interactive())
  
  > if (isTRUE(delay)) {
  +   delay <- function(counts) Sys.sleep(rexp(1, rate = 2))
  + } else if (!is.function(delay)) {
  +   delay <- function(counts) {}
  + }
  
  > ## Generate Mandelbrot tiles to be computed
  > Cs <- mandelbrot_tiles(xmid = region$xmid, ymid = region$ymid,
  +                        side = region$side, nrow = nrow,
  +                        resolution = resolution)
  
  > if (interactive()) {
  +   if (.Platform$GUI == "RStudio") {
  +     if (!"RStudioGD" %in% names(dev.list())) dev.new()
  +   }
  +   dev.new()
  +   plot.new()
  +   split.screen(dim(Cs))
  +   for (ii in seq_along(Cs)) {
  +     screen(ii)
  +     par(mar = c(0, 0, 0, 0))
  +     text(x = 1 / 2, y = 1 / 2, sprintf("Future #%d\nunresolved", ii), cex = 2)
  +   }
  + } else {
  +   split.screen(dim(Cs))
  + }
  [1] 1 2 3 4 5 6 7 8 9
  
  > counts <- list()
  
  > n <- length(Cs)
  
  > for (ii in seq_len(n)) {
  +   cat(sprintf("Mandelbrot tile #%d of %d ...\n", ii, n))
  +   C <- Cs[[ii]]
  + 
  +   counts[[ii]] <- future({
  +     cat(sprintf("Calculating tile #%d of %d ...\n", ii, n))
  +     fit <- mandelbrot(C)
  + 
  +     ## Emulate slowness
  +     delay(fit)
  + 
  +     cat(sprintf("Calculating tile #%d of %d ... done\n", ii, n))
  +     fit
  +   })
  + 
  +   ## Plot tiles that are already resolved
  +   counts <- plot_what_is_done(counts)
  + }
  Mandelbrot tile #1 of 9 ...
  getGlobalsAndPackages() ...
  Searching for globals ...
  - globals found: [9] '{', 'cat', 'sprintf', 'ii', 'n', '<-', 'mandelbrot', 'C', 'delay'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 4 globals is 285.04 KiB (291880 bytes)
  - globals: [4] 'ii', 'n', 'C', 'delay'
  - packages: [1] 'future'
  getGlobalsAndPackages() ... DONE
  Error: [ENOENT] Failed to realize 'C:/Users/CRAN/.batchtools.conf.R': no such file or directory
  Execution halted
Running the tests in 'tests/dotdotdot.R' failed.
Complete output:
  > source("incl/start.R")
  Loading required package: future
  plan(): nbrOfWorkers() = 1
  > library("listenv")
  > 
  > 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 c("sequential", "multiprocess",
  +                    "batchtools_interactive", "batchtools_local")) {
  +   plan(strategy, substitute = FALSE)
  + 
  +   for (name in names(sum_fcns)) {
  +     mprintf("** Sum function '%s' with plan('%s') ...", 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)
  +     }
  +   }
  + }
  plan(): nbrOfWorkers() = 1
  ** Sum function 'A' with plan('sequential') ...function (x, ...) 
  {
      message("Arguments '...' exists: ", exists("...", inherits = TRUE))
      y %<-% {
          sum(x, ...)
      }
      y
  }
  Arguments '...' exists: TRUE
  getGlobalsAndPackages() ...
  Searching for globals ...
  - globals found: [4] '{', 'sum', 'x', '...'
  Searching for globals ... DONE
  Resolving globals: FALSE
  Tweak future expression to call with '...' arguments ...
  Tweak future expression to call with '...' arguments ... DONE
  The total size of the 2 globals is 112 bytes (112 bytes)
  - globals: [2] 'x', 'future.call.arguments'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 0): <none>
  {
      {
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore")
          {
              {
                  has_future <- requireNamespace("future", quietly = TRUE)
                  version <- if (has_future) 
                    packageVersion("future")
                  else NULL
                  if (!has_future || version < "1.8.0") {
                    info <- c(r_version = gsub("R version ", "", 
                      R.version$version.string), platform = sprintf("%s (%s-bit)", 
                      R.version$platform, 8 * .Machine$sizeof.pointer), 
                      os = paste(Sys.info()[c("sysname", "release", 
                        "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                    info <- sprintf("%s: %s", names(info), info)
                    info <- paste(info, collapse = "; ")
                    if (!has_future) {
                      msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                        info)
                    }
                    else {
                      msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                        info, version)
                    }
                    stop(msg)
                  }
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      tryCatch({
          ...future.value <- local({
              sum(x, ...)
          })
          future::FutureResult(value = ...future.value, version = "1.8")
      }, error = function(cond) {
          calls <- sys.calls()
          structure(list(value = NULL, condition = cond, calls = calls, 
              version = "1.8"), class = "FutureResult")
      }, finally = {
          {
              {
                  NULL
                  future::plan(list(function (expr, envir = parent.frame(), 
                    substitute = TRUE, lazy = FALSE, seed = NULL, 
                    globals = TRUE, local = TRUE, earlySignal = FALSE, 
                    label = NULL, ...) 
                  {
                    if (substitute) 
                      expr <- substitute(expr)
                    local <- as.logical(local)
                    future <- SequentialFuture(expr = expr, envir = envir, 
                      substitute = FALSE, lazy = lazy, seed = seed, 
                      globals = globals, local = local, earlySignal = earlySignal, 
                      label = label, ...)
                    if (!future$lazy) 
                      future <- run(future)
                    invisible(future)
                  }), .cleanup = FALSE, .init = FALSE)
              }
              options(...future.oldOptions)
          }
      })
  }
  plan(): nbrOfWorkers() = 1
  SequentialFuture started (and completed)
  [1] 6
  ** Sum function 'B' with plan('sequential') ...function (x, ...) 
  {
      sumt <- function(x) {
          message("Arguments '...' exists: ", exists("...", inherits = TRUE))
          y %<-% {
              sum(x, ...)
          }
          y
      }
      sumt(x)
  }
  Arguments '...' exists: TRUE
  getGlobalsAndPackages() ...
  Searching for globals ...
  - globals found: [4] '{', 'sum', 'x', '...'
  Searching for globals ... DONE
  Resolving globals: FALSE
  Tweak future expression to call with '...' arguments ...
  Tweak future expression to call with '...' arguments ... DONE
  The total size of the 2 globals is 112 bytes (112 bytes)
  - globals: [2] 'x', 'future.call.arguments'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 0): <none>
  {
      {
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore")
          {
              {
                  has_future <- requireNamespace("future", quietly = TRUE)
                  version <- if (has_future) 
                    packageVersion("future")
                  else NULL
                  if (!has_future || version < "1.8.0") {
                    info <- c(r_version = gsub("R version ", "", 
                      R.version$version.string), platform = sprintf("%s (%s-bit)", 
                      R.version$platform, 8 * .Machine$sizeof.pointer), 
                      os = paste(Sys.info()[c("sysname", "release", 
                        "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                    info <- sprintf("%s: %s", names(info), info)
                    info <- paste(info, collapse = "; ")
                    if (!has_future) {
                      msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                        info)
                    }
                    else {
                      msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                        info, version)
                    }
                    stop(msg)
                  }
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      tryCatch({
          ...future.value <- local({
              sum(x, ...)
          })
          future::FutureResult(value = ...future.value, version = "1.8")
      }, error = function(cond) {
          calls <- sys.calls()
          structure(list(value = NULL, condition = cond, calls = calls, 
              version = "1.8"), class = "FutureResult")
      }, finally = {
          {
              {
                  NULL
                  future::plan(list(function (expr, envir = parent.frame(), 
                    substitute = TRUE, lazy = FALSE, seed = NULL, 
                    globals = TRUE, local = TRUE, earlySignal = FALSE, 
                    label = NULL, ...) 
                  {
                    if (substitute) 
                      expr <- substitute(expr)
                    local <- as.logical(local)
                    future <- SequentialFuture(expr = expr, envir = envir, 
                      substitute = FALSE, lazy = lazy, seed = seed, 
                      globals = globals, local = local, earlySignal = earlySignal, 
                      label = label, ...)
                    if (!future$lazy) 
                      future <- run(future)
                    invisible(future)
                  }), .cleanup = FALSE, .init = FALSE)
              }
              options(...future.oldOptions)
          }
      })
  }
  plan(): nbrOfWorkers() = 1
  SequentialFuture started (and completed)
  [1] 6
  ** Sum function 'C' with plan('sequential') ...function (x, y) 
  {
      message("Arguments '...' exists: ", exists("...", inherits = TRUE))
      y %<-% {
          sum(x, y)
      }
      y
  }
  Arguments '...' exists: FALSE
  getGlobalsAndPackages() ...
  Searching for globals ...
  - globals found: [4] '{', 'sum', 'x', 'y'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 2 globals is 112 bytes (112 bytes)
  - globals: [2] 'x', 'y'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 0): <none>
  {
      {
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore")
          {
              {
                  has_future <- requireNamespace("future", quietly = TRUE)
                  version <- if (has_future) 
                    packageVersion("future")
                  else NULL
                  if (!has_future || version < "1.8.0") {
                    info <- c(r_version = gsub("R version ", "", 
                      R.version$version.string), platform = sprintf("%s (%s-bit)", 
                      R.version$platform, 8 * .Machine$sizeof.pointer), 
                      os = paste(Sys.info()[c("sysname", "release", 
                        "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                    info <- sprintf("%s: %s", names(info), info)
                    info <- paste(info, collapse = "; ")
                    if (!has_future) {
                      msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                        info)
                    }
                    else {
                      msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                        info, version)
                    }
                    stop(msg)
                  }
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      tryCatch({
          ...future.value <- local({
              sum(x, y)
          })
          future::FutureResult(value = ...future.value, version = "1.8")
      }, error = function(cond) {
          calls <- sys.calls()
          structure(list(value = NULL, condition = cond, calls = calls, 
              version = "1.8"), class = "FutureResult")
      }, finally = {
          {
              {
                  NULL
                  future::plan(list(function (expr, envir = parent.frame(), 
                    substitute = TRUE, lazy = FALSE, seed = NULL, 
                    globals = TRUE, local = TRUE, earlySignal = FALSE, 
                    label = NULL, ...) 
                  {
                    if (substitute) 
                      expr <- substitute(expr)
                    local <- as.logical(local)
                    future <- SequentialFuture(expr = expr, envir = envir, 
                      substitute = FALSE, lazy = lazy, seed = seed, 
                      globals = globals, local = local, earlySignal = earlySignal, 
                      label = label, ...)
                    if (!future$lazy) 
                      future <- run(future)
                    invisible(future)
                  }), .cleanup = FALSE, .init = FALSE)
              }
              options(...future.oldOptions)
          }
      })
  }
  plan(): nbrOfWorkers() = 1
  SequentialFuture started (and completed)
  [1] 6
  ** Sum function 'D' with plan('sequential') ...function (x, y) 
  {
      message("Arguments '...' exists: ", exists("...", inherits = TRUE))
      y %<-% {
          sum(x, y, ...)
      }
      y
  }
  Arguments '...' exists: FALSE
  getGlobalsAndPackages() ...
  Searching for globals ...
  - globals found: [5] '{', 'sum', 'x', 'y', '...'
  Searching for globals ... DONE
  Resolving globals: FALSE
  Tweak future expression to call with '...' arguments ...
  Did you mean to create the future within a function?  Invalid future expression tries to use global '...' variables that do not exist: {; sum(x, y, ...); }
  Error in getGlobalsAndPackages(expr, envir = envir, tweak = tweakExpression,  : 
    Did you mean to create the future within a function?  Invalid future expression tries to use global '...' variables that do not exist: {; sum(x, y, ...); }
  [1] "Error in getGlobalsAndPackages(expr, envir = envir, tweak = tweakExpression,  : \n  Did you mean to create the future within a function?  Invalid future expression tries to use global '...' variables that do not exist: {; sum(x, y, ...); }\n"
  attr(,"class")
  [1] "try-error"
  attr(,"condition")
  <simpleError in getGlobalsAndPackages(expr, envir = envir, tweak = tweakExpression,     globals = globals): Did you mean to create the future within a function?  Invalid future expression tries to use global '...' variables that do not exist: {; sum(x, y, ...); }>
  plan(): nbrOfWorkers() = 2
  ** Sum function 'A' with plan('multiprocess') ...function (x, ...) 
  {
      message("Arguments '...' exists: ", exists("...", inherits = TRUE))
      y %<-% {
          sum(x, ...)
      }
      y
  }
  Arguments '...' exists: TRUE
  Workers: [n = 2] 'localhost', 'localhost'
  Warning in makeClusterPSOCK(workers, ...) :
    Non-numeric value of environment variable 'R_PARALLEL_PORT' coerced to NA_integer_: 'random'
  Base port: 11953
  Creating node 1 of 2 ...
  - setting up node
  Starting worker #1 on 'localhost': "D:/RCompile/recent/R/bin/x64/Rscript" --default-packages=datasets,utils,grDevices,graphics,stats,methods -e "parallel:::.slaveRSOCK()" MASTER=localhost PORT=11953 OUT=/dev/null TIMEOUT=2592000 XDR=TRUE
  Waiting for worker #1 on 'localhost' to connect back
  Connection with worker #1 on 'localhost' established
  - assigning connection UUID
  - collecting session information
  Creating node 1 of 2 ... done
  Creating node 2 of 2 ...
  - setting up node
  Starting worker #2 on 'localhost': "D:/RCompile/recent/R/bin/x64/Rscript" --default-packages=datasets,utils,grDevices,graphics,stats,methods -e "parallel:::.slaveRSOCK()" MASTER=localhost PORT=11953 OUT=/dev/null TIMEOUT=2592000 XDR=TRUE
  Waiting for worker #2 on 'localhost' to connect back
  Connection with worker #2 on 'localhost' established
  - assigning connection UUID
  - collecting session information
  Creating node 2 of 2 ... done
  getGlobalsAndPackages() ...
  Searching for globals ...
  - globals found: [4] '{', 'sum', 'x', '...'
  Searching for globals ... DONE
  Resolving globals: FALSE
  Tweak future expression to call with '...' arguments ...
  Tweak future expression to call with '...' arguments ... DONE
  The total size of the 2 globals is 112 bytes (112 bytes)
  - globals: [2] 'x', 'future.call.arguments'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 0): <none>
  {
      {
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore")
          {
              {
                  {
                    has_future <- requireNamespace("future", quietly = TRUE)
                    version <- if (has_future) 
                      packageVersion("future")
                    else NULL
                    if (!has_future || version < "1.8.0") {
                      info <- c(r_version = gsub("R version ", 
                        "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                        R.version$platform, 8 * .Machine$sizeof.pointer), 
                        os = paste(Sys.info()[c("sysname", "release", 
                          "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                      info <- sprintf("%s: %s", names(info), info)
                      info <- paste(info, collapse = "; ")
                      if (!has_future) {
                        msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                          info)
                      }
                      else {
                        msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                          info, version)
                      }
                      stop(msg)
                    }
                  }
                  ...future.mc.cores.old <- getOption("mc.cores")
                  options(mc.cores = 1L)
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      tryCatch({
          ...future.value <- local({
              do.call(function(...) {
                  sum(x, ...)
              }, args = future.call.arguments)
          })
          future::FutureResult(value = ...future.value, version = "1.8")
      }, error = function(cond) {
          calls <- sys.calls()
          structure(list(value = NULL, condition = cond, calls = calls, 
              version = "1.8"), class = "FutureResult")
      }, finally = {
          {
              {
                  {
                    options(mc.cores = ...future.mc.cores.old)
                  }
                  future::plan(list(function (expr, envir = parent.frame(), 
                    substitute = TRUE, lazy = FALSE, seed = NULL, 
                    globals = TRUE, workers = availableCores(), 
                    gc = FALSE, earlySignal = FALSE, label = NULL, 
                    ...) 
                  {
                    if (substitute) 
                      expr <- substitute(expr)
                    fun <- if (supportsMulticore()) 
                      multicore
                    else multisession
                    fun(expr = expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      workers = workers, gc = gc, earlySignal = earlySignal, 
                      label = label, ...)
                  }), .cleanup = FALSE, .init = FALSE)
              }
              options(...future.oldOptions)
          }
      })
  }
  Exporting 2 global objects (112 bytes) to cluster node #1 ...
  Exporting 'x' (56 bytes) to cluster node #1 ...
  Exporting 'x' (56 bytes) to cluster node #1 ... DONE
  Exporting 'future.call.arguments' (56 bytes) to cluster node #1 ...
  Exporting 'future.call.arguments' (56 bytes) to cluster node #1 ... DONE
  Exporting 2 global objects (112 bytes) to cluster node #1 ... DONE
  MultisessionFuture started
  [1] 6
  ** Sum function 'B' with plan('multiprocess') ...function (x, ...) 
  {
      sumt <- function(x) {
          message("Arguments '...' exists: ", exists("...", inherits = TRUE))
          y %<-% {
              sum(x, ...)
          }
          y
      }
      sumt(x)
  }
  Arguments '...' exists: TRUE
  getGlobalsAndPackages() ...
  Searching for globals ...
  - globals found: [4] '{', 'sum', 'x', '...'
  Searching for globals ... DONE
  Resolving globals: FALSE
  Tweak future expression to call with '...' arguments ...
  Tweak future expression to call with '...' arguments ... DONE
  The total size of the 2 globals is 112 bytes (112 bytes)
  - globals: [2] 'x', 'future.call.arguments'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 0): <none>
  {
      {
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore")
          {
              {
                  {
                    has_future <- requireNamespace("future", quietly = TRUE)
                    version <- if (has_future) 
                      packageVersion("future")
                    else NULL
                    if (!has_future || version < "1.8.0") {
                      info <- c(r_version = gsub("R version ", 
                        "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                        R.version$platform, 8 * .Machine$sizeof.pointer), 
                        os = paste(Sys.info()[c("sysname", "release", 
                          "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                      info <- sprintf("%s: %s", names(info), info)
                      info <- paste(info, collapse = "; ")
                      if (!has_future) {
                        msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                          info)
                      }
                      else {
                        msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                          info, version)
                      }
                      stop(msg)
                    }
                  }
                  ...future.mc.cores.old <- getOption("mc.cores")
                  options(mc.cores = 1L)
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      tryCatch({
          ...future.value <- local({
              do.call(function(...) {
                  sum(x, ...)
              }, args = future.call.arguments)
          })
          future::FutureResult(value = ...future.value, version = "1.8")
      }, error = function(cond) {
          calls <- sys.calls()
          structure(list(value = NULL, condition = cond, calls = calls, 
              version = "1.8"), class = "FutureResult")
      }, finally = {
          {
              {
                  {
                    options(mc.cores = ...future.mc.cores.old)
                  }
                  future::plan(list(function (expr, envir = parent.frame(), 
                    substitute = TRUE, lazy = FALSE, seed = NULL, 
                    globals = TRUE, workers = availableCores(), 
                    gc = FALSE, earlySignal = FALSE, label = NULL, 
                    ...) 
                  {
                    if (substitute) 
                      expr <- substitute(expr)
                    fun <- if (supportsMulticore()) 
                      multicore
                    else multisession
                    fun(expr = expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      workers = workers, gc = gc, earlySignal = earlySignal, 
                      label = label, ...)
                  }), .cleanup = FALSE, .init = FALSE)
              }
              options(...future.oldOptions)
          }
      })
  }
  Exporting 2 global objects (112 bytes) to cluster node #1 ...
  Exporting 'x' (56 bytes) to cluster node #1 ...
  Exporting 'x' (56 bytes) to cluster node #1 ... DONE
  Exporting 'future.call.arguments' (56 bytes) to cluster node #1 ...
  Exporting 'future.call.arguments' (56 bytes) to cluster node #1 ... DONE
  Exporting 2 global objects (112 bytes) to cluster node #1 ... DONE
  MultisessionFuture started
  [1] 6
  ** Sum function 'C' with plan('multiprocess') ...function (x, y) 
  {
      message("Arguments '...' exists: ", exists("...", inherits = TRUE))
      y %<-% {
          sum(x, y)
      }
      y
  }
  Arguments '...' exists: FALSE
  getGlobalsAndPackages() ...
  Searching for globals ...
  - globals found: [4] '{', 'sum', 'x', 'y'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 2 globals is 112 bytes (112 bytes)
  - globals: [2] 'x', 'y'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 0): <none>
  {
      {
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore")
          {
              {
                  {
                    has_future <- requireNamespace("future", quietly = TRUE)
                    version <- if (has_future) 
                      packageVersion("future")
                    else NULL
                    if (!has_future || version < "1.8.0") {
                      info <- c(r_version = gsub("R version ", 
                        "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                        R.version$platform, 8 * .Machine$sizeof.pointer), 
                        os = paste(Sys.info()[c("sysname", "release", 
                          "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                      info <- sprintf("%s: %s", names(info), info)
                      info <- paste(info, collapse = "; ")
                      if (!has_future) {
                        msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                          info)
                      }
                      else {
                        msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                          info, version)
                      }
                      stop(msg)
                    }
                  }
                  ...future.mc.cores.old <- getOption("mc.cores")
                  options(mc.cores = 1L)
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      tryCatch({
          ...future.value <- local({
              sum(x, y)
          })
          future::FutureResult(value = ...future.value, version = "1.8")
      }, error = function(cond) {
          calls <- sys.calls()
          structure(list(value = NULL, condition = cond, calls = calls, 
              version = "1.8"), class = "FutureResult")
      }, finally = {
          {
              {
                  {
                    options(mc.cores = ...future.mc.cores.old)
                  }
                  future::plan(list(function (expr, envir = parent.frame(), 
                    substitute = TRUE, lazy = FALSE, seed = NULL, 
                    globals = TRUE, workers = availableCores(), 
                    gc = FALSE, earlySignal = FALSE, label = NULL, 
                    ...) 
                  {
                    if (substitute) 
                      expr <- substitute(expr)
                    fun <- if (supportsMulticore()) 
                      multicore
                    else multisession
                    fun(expr = expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      workers = workers, gc = gc, earlySignal = earlySignal, 
                      label = label, ...)
                  }), .cleanup = FALSE, .init = FALSE)
              }
              options(...future.oldOptions)
          }
      })
  }
  Exporting 2 global objects (112 bytes) to cluster node #1 ...
  Exporting 'x' (56 bytes) to cluster node #1 ...
  Exporting 'x' (56 bytes) to cluster node #1 ... DONE
  Exporting 'y' (56 bytes) to cluster node #1 ...
  Exporting 'y' (56 bytes) to cluster node #1 ... DONE
  Exporting 2 global objects (112 bytes) to cluster node #1 ... DONE
  MultisessionFuture started
  [1] 6
  ** Sum function 'D' with plan('multiprocess') ...function (x, y) 
  {
      message("Arguments '...' exists: ", exists("...", inherits = TRUE))
      y %<-% {
          sum(x, y, ...)
      }
      y
  }
  Arguments '...' exists: FALSE
  getGlobalsAndPackages() ...
  Searching for globals ...
  - globals found: [5] '{', 'sum', 'x', 'y', '...'
  Searching for globals ... DONE
  Resolving globals: FALSE
  Tweak future expression to call with '...' arguments ...
  Did you mean to create the future within a function?  Invalid future expression tries to use global '...' variables that do not exist: {; sum(x, y, ...); }
  Error in getGlobalsAndPackages(expr, envir = envir, persistent = persistent,  : 
    Did you mean to create the future within a function?  Invalid future expression tries to use global '...' variables that do not exist: {; sum(x, y, ...); }
  [1] "Error in getGlobalsAndPackages(expr, envir = envir, persistent = persistent,  : \n  Did you mean to create the future within a function?  Invalid future expression tries to use global '...' variables that do not exist: {; sum(x, y, ...); }\n"
  attr(,"class")
  [1] "try-error"
  attr(,"condition")
  <simpleError in getGlobalsAndPackages(expr, envir = envir, persistent = persistent,     globals = globals): Did you mean to create the future within a function?  Invalid future expression tries to use global '...' variables that do not exist: {; sum(x, y, ...); }>
  plan(): nbrOfWorkers() = 1
  ** Sum function 'A' with plan('batchtools_interactive') ...function (x, ...) 
  {
      message("Arguments '...' exists: ", exists("...", inherits = TRUE))
      y %<-% {
          sum(x, ...)
      }
      y
  }
  <bytecode: 0x0000000008c74930>
  Arguments '...' exists: TRUE
  getGlobalsAndPackages() ...
  Searching for globals ...
  - globals found: [4] '{', 'sum', 'x', '...'
  Searching for globals ... DONE
  Resolving globals: FALSE
  Tweak future expression to call with '...' arguments ...
  Tweak future expression to call with '...' arguments ... DONE
  The total size of the 2 globals is 112 bytes (112 bytes)
  - globals: [2] 'x', 'future.call.arguments'
  
  getGlobalsAndPackages() ... DONE
  Error : [ENOENT] Failed to realize 'C:/Users/CRAN/.batchtools.conf.R': no such file or directory
  [1] "Error : [ENOENT] Failed to realize 'C:/Users/CRAN/.batchtools.conf.R': no such file or directory\n"
  attr(,"class")
  [1] "try-error"
  attr(,"condition")
  <ENOENT: [ENOENT] Failed to realize 'C:/Users/CRAN/.batchtools.conf.R': no such file or directory>
  Error: y == 6 is not TRUE
  Execution halted
Running the tests in 'tests/future,labels.R' failed.
Complete output:
  > source("incl/start.R")
  Loading required package: future
  plan(): nbrOfWorkers() = 1
  > 
  > message("*** Futures - labels ...")
  *** Futures - labels ...
  > 
  > strategies <- c("batchtools_local")
  > 
  > for (strategy in strategies) {
  +   mprintf("- plan('%s') ...", strategy)
  +   plan(strategy)
  + 
  +   for (label in list(NULL, sprintf("strategy_%s", strategy))) {
  +     fcn <- get(strategy, mode = "function")
  +     stopifnot(inherits(fcn, strategy))
  +     f <- fcn(42, label = label)
  +     print(f)
  +     stopifnot(identical(f$label, label))
  +     v <- value(f)
  +     stopifnot(v == 42)
  + 
  +     f <- future(42, label = label)
  +     print(f)
  +     stopifnot(identical(f$label, label))
  +     v <- value(f)
  +     stopifnot(v == 42)
  + 
  +     v %<-% { 42 } %label% label
  +     f <- futureOf(v)
  +     print(f)
  +     stopifnot(identical(f$label, label))
  +     stopifnot(v == 42)
  + 
  +   } ## for (label ...)
  + 
  +   mprintf("- plan('%s') ... DONE", strategy)
  + } ## for (strategy ...)
  - plan('batchtools_local') ...plan(): nbrOfWorkers() = 1
  getGlobalsAndPackages() ...
  Searching for globals ...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  Error: [ENOENT] Failed to realize 'C:/Users/CRAN/.batchtools.conf.R': no such file or directory
  Execution halted
Running the tests in 'tests/future,lazy.R' failed.
Complete output:
  > source("incl/start.R")
  Loading required package: future
  plan(): nbrOfWorkers() = 1
  > 
  > message("*** Futures - lazy ...")
  *** Futures - lazy ...
  > 
  > strategies <- c("batchtools_local")
  > 
  > for (strategy in strategies) {
  +   mprintf("- plan('%s') ...", strategy)
  +   plan(strategy)
  + 
  +   a <- 42
  +   f <- future(2 * a, lazy = TRUE)
  +   a <- 21
  +   v <- value(f)
  +   stopifnot(v == 84)
  + 
  +   a <- 42
  +   v %<-% { 2 * a } %lazy% TRUE
  +   a <- 21
  +   stopifnot(v == 84)
  + 
  +   mprintf("- plan('%s') ... DONE", strategy)
  + } ## for (strategy ...)
  - plan('batchtools_local') ...plan(): nbrOfWorkers() = 1
  getGlobalsAndPackages() ...
  Searching for globals ...
  - globals found: [2] '*', 'a'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 1 globals is 56 bytes (56 bytes)
  - globals: [1] 'a'
  
  getGlobalsAndPackages() ... DONE
  Error: [ENOENT] Failed to realize 'C:/Users/CRAN/.batchtools.conf.R': no such file or directory
  Execution halted
Running the tests in 'tests/globals,formulas.R' failed.
Complete output:
  > source("incl/start.R")
  Loading required package: future
  plan(): nbrOfWorkers() = 1
  > 
  > library("datasets") ## cars data set
  > library("stats")    ## lm(), poly(), xtabs()
  > 
  > plan(batchtools_local)
  plan(): nbrOfWorkers() = 1
  > 
  > message("*** Globals - formulas ...")
  *** Globals - formulas ...
  > 
  > message("*** Globals - lm(<formula>) ...")
  *** Globals - lm(<formula>) ...
  > 
  > ## From example("lm", package = "stats")
  > ctl <- c(4.17, 5.58, 5.18, 6.11, 4.50, 4.61, 5.17, 4.53, 5.33, 5.14)
  > trt <- c(4.81, 4.17, 4.41, 3.59, 5.87, 3.83, 6.03, 4.89, 4.32, 4.69)
  > group <- gl(2, 10, 20, labels = c("Ctl", "Trt"))
  > weight <- c(ctl, trt)
  > 
  > ## Truth:
  > fit0 <- lm(weight ~ group - 1)
  > print(fit0)
  
  Call:
  lm(formula = weight ~ group - 1)
  
  Coefficients:
  groupCtl  groupTrt  
     5.032     4.661  
  
  > 
  > ## Explicit future
  > f <- future({ lm(weight ~ group - 1) })
  getGlobalsAndPackages() ...
  Searching for globals ...
  - globals found: [6] '{', 'lm', 'weight', '-', 'group', '~'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 2 globals is 896 bytes (896 bytes)
  - globals: [2] 'weight', 'group'
  - packages: [1] 'stats'
  getGlobalsAndPackages() ... DONE
  Error: [ENOENT] Failed to realize 'C:/Users/CRAN/.batchtools.conf.R': no such file or directory
  Execution halted
Running the tests in 'tests/globals,manual.R' failed.
Complete output:
  > source("incl/start.R")
  Loading required package: future
  plan(): nbrOfWorkers() = 1
  > 
  > plan(batchtools_local)
  plan(): nbrOfWorkers() = 1
  > 
  > message("*** Globals - manually ...")
  *** Globals - manually ...
  > 
  > message("*** Globals manually specified as named list ...")
  *** Globals manually specified as named list ...
  > 
  > globals <- list(
  +   a = 1,
  +   b = 2,
  +   sumtwo = function(x) x[1] + x[2]
  + )
  > 
  > ## Assign 'globals' globally
  > attach_locally(globals)
  > 
  > ## Truth
  > v0 <- local({
  +   x <- 1:10
  +   sumtwo(a + b * x)
  + })
  > 
  > 
  > message("*** Globals - automatic ...")
  *** Globals - automatic ...
  > 
  > attach_locally(globals)
  > f <- future({
  +   x <- 1:10
  +   sumtwo(a + b * x)
  + }, globals = TRUE)
  getGlobalsAndPackages() ...
  Searching for globals ...
  - globals found: [9] '{', '<-', ':', 'sumtwo', '+', 'a', '*', 'b', '['
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 1.20 KiB (1232 bytes)
  - globals: [3] 'sumtwo', 'a', 'b'
  
  getGlobalsAndPackages() ... DONE
  Error: [ENOENT] Failed to realize 'C:/Users/CRAN/.batchtools.conf.R': no such file or directory
  Execution halted
Running the tests in 'tests/globals,subassignment.R' failed.
Complete output:
  > source("incl/start.R")
  Loading required package: future
  plan(): nbrOfWorkers() = 1
  > 
  > plan(batchtools_local)
  plan(): nbrOfWorkers() = 1
  > 
  > oopts <- c(oopts, options(
  +   future.globals.resolve = TRUE,
  +   future.globals.onMissing = "error"
  + ))
  > 
  > 
  > message("*** Globals - subassignments ...")
  *** Globals - subassignments ...
  > 
  > message("*** Globals - subassignments w/ x$a <- value ...")
  *** Globals - subassignments w/ x$a <- value ...
  > 
  > ## Truth:
  > x <- x0 <- list()
  > y0 <- list(a = 1)
  > str(list(x = x, y0 = y0))
  List of 2
   $ x : list()
   $ y0:List of 1
    ..$ a: num 1
  > 
  > y <- local({
  +   x$a <- 1
  +   x
  + })
  > stopifnot(identical(y, y0))
  > 
  > y <- local({
  +   x[["a"]] <- 1
  +   x
  + })
  > stopifnot(identical(y, y0))
  > 
  > y <- local({
  +   x["a"] <- list(1)
  +   x
  + })
  > stopifnot(identical(y, y0))
  > 
  > stopifnot(identical(x, list()))
  > 
  > ## Explicit future
  > x <- list()
  > f <- future({
  +   x$a <- 1
  +   x
  + })
  getGlobalsAndPackages() ...
  Searching for globals ...
  - globals found: [4] '{', 'x', '<-', '$<-'
  Searching for globals ... DONE
  Resolving globals: TRUE
  Resolving any globals that are futures ...
  - globals: [4] '{', 'x', '<-', '$<-'
  Resolving any globals that are futures ... DONE
  Resolving futures part of globals (recursively) ...
  resolve() on list ...
   recursive: 99
   length: 1
   elements: 'x'
   length: 0 (resolved future 1)
  resolve() on list ... DONE
  - globals: [1] 'x'
  Resolving futures part of globals (recursively) ... DONE
  The total size of the 1 globals is 0 bytes (0 bytes)
  - globals: [1] 'x'
  
  getGlobalsAndPackages() ... DONE
  Error: [ENOENT] Failed to realize 'C:/Users/CRAN/.batchtools.conf.R': no such file or directory
  Execution halted
Running the tests in 'tests/globals,tricky.R' failed.
Complete output:
  > source("incl/start.R")
  Loading required package: future
  plan(): nbrOfWorkers() = 1
  > library("listenv")
  > 
  > plan(batchtools_local)
  plan(): nbrOfWorkers() = 1
  > 
  > message("*** Tricky use cases related to globals ...")
  *** Tricky use cases related to globals ...
  > 
  > message("- Globals with the same name as 'base' objects ...")
  - Globals with the same name as 'base' objects ...
  > 
  > ## 'col' is masked by 'base::col' (Issue #55)
  > 
  > col <- 3
  > x %<-% { stopifnot(is.numeric(col)); col }
  getGlobalsAndPackages() ...
  Searching for globals ...
  - globals found: [4] '{', 'stopifnot', 'is.numeric', 'col'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 1 globals is 56 bytes (56 bytes)
  - globals: [1] 'col'
  
  getGlobalsAndPackages() ... DONE
  Error: [ENOENT] Failed to realize 'C:/Users/CRAN/.batchtools.conf.R': no such file or directory
  Execution halted
Running the tests in 'tests/plan.R' failed.
Complete output:
  > source("incl/start,load-only.R")
  R process uuid: 484f22e3-ec64-a33d-e705-6fc31635b66b
  Setting plan('default')
  plan(): nbrOfWorkers() = 1
  plan(): nbrOfWorkers() = 1
  > 
  > message("*** plan() ...")
  *** plan() ...
  > 
  > message("*** future::plan(future.batchtools::batchtools_local)")
  *** future::plan(future.batchtools::batchtools_local)
  > oplan <- future::plan(future.batchtools::batchtools_local)
  plan(): nbrOfWorkers() = 1
  > print(future::plan())
  batchtools_local:
  - args: function (expr, envir = parent.frame(), substitute = TRUE, globals = TRUE, label = NULL, workers = 1L, ...)
  - tweaked: FALSE
  - call: future::plan(future.batchtools::batchtools_local)
  > future::plan(oplan)
  plan(): nbrOfWorkers() = 1
  > print(future::plan())
  batchtools_local:
  - args: function (expr, envir = parent.frame(), substitute = TRUE, globals = TRUE, label = NULL, workers = 1L, ...)
  - tweaked: FALSE
  - call: future::plan(future.batchtools:::batchtools_local)
  > 
  > 
  > library("future.batchtools")
  Loading required package: future
  Future startup scripts identified: <none>
  > plan(batchtools_local)
  plan(): nbrOfWorkers() = 1
  > 
  > for (type in c("batchtools_interactive", "batchtools_local")) {
  +   mprintf("*** plan('%s') ...", type)
  + 
  +   plan(type)
  +   stopifnot(inherits(plan(), "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)
  + 
  +   mprintf("*** plan('%s') ... DONE", type)
  + } # for (type ...)
  *** plan('batchtools_interactive') ...plan(): nbrOfWorkers() = 1
  getGlobalsAndPackages() ...
  Searching for globals ...
  - globals found: [4] '{', '<-', '*', 'a'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 1 globals is 56 bytes (56 bytes)
  - globals: [1] 'a'
  
  getGlobalsAndPackages() ... DONE
  Error: [ENOENT] Failed to realize 'C:/Users/CRAN/.batchtools.conf.R': no such file or directory
  Execution halted
Running the tests in 'tests/resources_OP.R' failed.
Complete output:
  > source("incl/start.R")
  Loading required package: future
  plan(): nbrOfWorkers() = 1
  > 
  > message("*** %resources% ...")
  *** %resources% ...
  > 
  > plan(batchtools_local)
  plan(): nbrOfWorkers() = 1
  > 
  > ## This will test `%resources%` but it'll be ignored
  > ## (with a warning) by batchtools_local()
  > y %<-% { 42 } %resources% list(mem = "42gb")
  Warning in tweak.future(function (expr, envir = parent.frame(), substitute = TRUE,  :
    Ignored 1 unknown arguments: 'resources'
  plan(): nbrOfWorkers() = 1
  getGlobalsAndPackages() ...
  Searching for globals ...
  - globals found: [1] '{'
  Searching for globals ... DONE
  Resolving globals: FALSE
  
  
  getGlobalsAndPackages() ... DONE
  Error: [ENOENT] Failed to realize 'C:/Users/CRAN/.batchtools.conf.R': no such file or directory
  Execution halted
Running the tests in 'tests/zzz,future_lapply.R' failed.
Complete output:
  > source("incl/start.R")
  Loading required package: future
  plan(): nbrOfWorkers() = 1
  > library("listenv")
  > future_lapply <- future.apply::future_lapply
  > 
  > cf <- batchtools::makeClusterFunctionsInteractive(external = TRUE)
  > batchtools_custom_local <- function(expr, substitute = TRUE,
  +                                     cluster.functions = cf, ...) {
  +   if (substitute) expr <- substitute(expr)
  +   batchtools_custom(expr, substitute = FALSE, ...,
  +                     cluster.functions = cluster.functions)
  + }
  > class(batchtools_custom_local) <- c("batchtools_custom_local",
  +                                     class(batchtools_custom))
  > 
  > strategies <- c("batchtools_interactive", "batchtools_local",
  +                 "batchtools_custom_local")
  > 
  > message("*** future_lapply() ...")
  *** future_lapply() ...
  > 
  > message("- future_lapply(x, FUN = vector, ...) ...")
  - future_lapply(x, FUN = vector, ...) ...
  > 
  > x <- list(a = "integer", b = "numeric", c = "character", c = "list")
  > str(list(x = x))
  List of 1
   $ x:List of 4
    ..$ a: chr "integer"
    ..$ b: chr "numeric"
    ..$ c: chr "character"
    ..$ c: chr "list"
  > 
  > y0 <- lapply(x, FUN = vector, length = 2L)
  > str(list(y0 = y0))
  List of 1
   $ y0:List of 4
    ..$ a: int [1:2] 0 0
    ..$ b: num [1:2] 0 0
    ..$ c: chr [1:2] "" ""
    ..$ c:List of 2
    .. ..$ : NULL
    .. ..$ : NULL
  > 
  > for (scheduling in list(FALSE, TRUE)) {
  +   for (strategy in strategies) {
  +     mprintf("- plan('%s') ...", strategy)
  +     plan(strategy)
  +     stopifnot(nbrOfWorkers() < Inf)
  + 
  +     y <- future_lapply(x, FUN = vector, length = 2L,
  +                        future.scheduling = scheduling)
  +     str(list(y = y))
  +     stopifnot(identical(y, y0))
  +   }
  + }
  - plan('batchtools_interactive') ...plan(): nbrOfWorkers() = 1
  future_lapply() ...
  Finding globals ...
  getGlobalsAndPackages() ...
  Searching for globals ...
  - globals found: [2] 'FUN', '.Internal'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 1 globals is 2.08 KiB (2128 bytes)
  - globals: [1] 'FUN'
  
  getGlobalsAndPackages() ... DONE
   - globals found: [1] 'FUN'
  
  Finding globals ... DONE
  Getting '...' globals ...
  resolve() on list ...
   recursive: 0
   length: 1
   elements: '...'
   length: 0 (resolved future 1)
  resolve() on list ... DONE
  Getting '...' globals ... DONE
  Globals to be used in all futures:
  List of 2
   $ ...future.FUN:function (mode = "logical", length = 0L)  
   $ ...          :List of 1
    ..$ length: int 2
    ..- attr(*, "class")= chr [1:2] "DotDotDotList" "list"
   - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
   - attr(*, "where")=List of 2
    ..$ ...future.FUN:<environment: 0x0000000006c05de0> 
    ..$ ...          :<environment: 0x0000000006c05de0> 
   - attr(*, "resolved")= logi FALSE
   - attr(*, "total_size")= num 2184
  Packages to be attached in all futures:
   chr(0) 
  Number of chunks: 4
  Number of futures (= number of chunks): 4
  Launching 4 futures (chunks) ...
  Chunk #1 of 4 ...
   - seeds: <none>
  getGlobalsAndPackages() ...
  - globals passed as-is: [4] '...future.FUN', '...', '...future.X_ii', '...future.seeds_ii'
  Resolving globals: FALSE
  Tweak future expression to call with '...' arguments ...
  Tweak future expression to call with '...' arguments ... DONE
  The total size of the 4 globals is 2.24 KiB (2296 bytes)
  - globals: [4] '...future.FUN', 'future.call.arguments', '...future.X_ii', '...future.seeds_ii'
  
  getGlobalsAndPackages() ... DONE
  Error: [ENOENT] Failed to realize 'C:/Users/CRAN/.batchtools.conf.R': no such file or directory
  Execution halted