Running ‘DEPRECATED.R’ [2s/3s]
  Running ‘doRNG,dopar.R’ [4s/9s]
  Running ‘doRNG,dorng.R’ [7s/16s]
  Running ‘foreach,errors.R’ [5s/21s]
  Running ‘foreach,globals.R’ [4s/9s]
  Running ‘foreach,nested.R’ [6s/25s]
  Running ‘foreach,nested_dopar.R’ [7s/49s]
  Running ‘foreach.R’ [3s/4s]
Running the tests in ‘tests/foreach.R’ failed.
Complete output:
  > source("incl/start.R")
  Loading required package: future
  Loading required package: foreach
  Loading required package: iterators
  Loading required package: parallel
  > 
  > strategies <- future:::supportedStrategies()
  > strategies <- setdiff(strategies, "multiprocess")
  > 
  > message("*** doFuture - reproducibility ...")
  *** doFuture - reproducibility ...
  > 
  > res0 <- NULL
  > 
  > for (strategy in strategies) {
  +   message(sprintf("- plan('%s') ...", strategy))
  +   plan(strategy)
  + 
  +   mu <- 1.0
  +   sigma <- 2.0
  +   res <- foreach(i = 1:3, .packages = "stats") %dopar% {
  +     set.seed(0xBEEF)
  +     rnorm(i, mean = mu, sd = sigma)
  +   }
  +   print(res)
  + 
  +   if (is.null(res0)) {
  +     res0 <- res
  +   } else {
  +     stopifnot(all.equal(res, res0))
  +   }
  + 
  +   if (require(plyr, character.only = TRUE)) {
  +     message("*** dplyr w / doFuture + parallel ...")
  + 
  +     print(sessionInfo())
  + 
  +     x <- list(a = 1:10, beta = exp(-3:3), logic = c(TRUE, FALSE, FALSE, TRUE))
  +     y0 <- llply(x, quantile, probs = (1:3) / 4, .parallel = FALSE)
  +     print(y0)
  +     y1 <- llply(x, quantile, probs = (1:3) / 4, .parallel = TRUE)
  +     print(y1)
  +     stopifnot(all.equal(y1, y0))
  + 
  +     message("*** dplyr w / doFuture + parallel ... DONE")
  +   } ## if (require(plyr))
  + 
  +   if (require(BiocParallel, character.only = TRUE) &&
  +       packageVersion("BiocParallel") >= "1.2.22") {
  +     message("*** BiocParallel w / doFuture + parallel ...")
  + 
  +     print(sessionInfo())
  + 
  +     y0 <- list()
  +     p <- SerialParam()
  +     y0$a <- bplapply(1:5, sqrt, BPPARAM = p)
  +     y0$b <- bpvec(1:5, sqrt, BPPARAM = p)
  +     str(y0)
  + 
  +     register(SerialParam(), default = TRUE)
  +     p <- DoparParam()
  +     y1 <- list()
  +     y1$a <- bplapply(1:5, sqrt, BPPARAM = p)
  +     y1$b <- bpvec(1:5, sqrt, BPPARAM = p)
  +     stopifnot(identical(y1, y0))
  + 
  +     register(DoparParam(), default = TRUE)
  +     y2 <- list()
  +     y2$a <- bplapply(1:5, sqrt, BPPARAM = p)
  +     y2$b <- bpvec(1:5, sqrt, BPPARAM = p)
  +     stopifnot(identical(y2, y0))
  + 
  +     message("*** BiocParallel w / doFuture + parallel ... DONE")
  +   } ## if (require(BiocParallel))
  + 
  +   message(sprintf("- plan('%s') ... DONE", strategy))
  + } ## for (strategy ...)
  - plan('sequential') ...
  doFuture() ...
  - dummy globals (as locals): [1] 'i'
  - R expression:
  {
      doFuture::registerDoFuture()
      lapply(seq_along(...future.x_ii), FUN = function(jj) {
          ...future.x_jj <- ...future.x_ii[[jj]]
          i <- NULL
          ...future.env <- environment()
          local({
              for (name in names(...future.x_jj)) {
                  assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                    inherits = FALSE)
              }
          })
          tryCatch({
              library("stats")
              {
                  set.seed(48879)
                  rnorm(i, mean = mu, sd = sigma)
              }
          }, error = identity)
      })
  }
  - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals ...
  - globals found: [19] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'library', 'set.seed', 'rnorm', 'mu', 'sigma', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 109.32 KiB (111944 bytes)
  - globals: [3] '...future.x_ii', 'mu', 'sigma'
  - packages: [1] 'stats'
  getGlobalsAndPackages() ... DONE
    - globals: [3] '...future.x_ii', 'mu', 'sigma'
  List of 3
   $ ...future.x_ii: NULL
   $ mu            : num 1
   $ sigma         : num 2
   - attr(*, "where")=List of 3
    ..$ ...future.x_ii:<environment: 0x556c16d5cdf8> 
    ..$ mu            :<environment: R_GlobalEnv> 
    ..$ sigma         :<environment: R_GlobalEnv> 
   - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
   - attr(*, "resolved")= logi FALSE
   - attr(*, "total_size")= num 111944
    - packages: [1] 'stats'
    - R expression:
  {
      doFuture::registerDoFuture()
      lapply(seq_along(...future.x_ii), FUN = function(jj) {
          ...future.x_jj <- ...future.x_ii[[jj]]
          i <- NULL
          ...future.env <- environment()
          local({
              for (name in names(...future.x_jj)) {
                  assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                    inherits = FALSE)
              }
          })
          tryCatch({
              library("stats")
              {
                  set.seed(48879)
                  rnorm(i, mean = mu, sd = sigma)
              }
          }, error = identity)
      })
  }
  - identifying globals and packages ... DONE
  Number of chunks: 1
  Number of futures (= number of chunks): 1
  Launching 1 futures (chunks) ...
  Chunk #1 of 1 ...
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'mu', 'sigma'
  Resolving globals: FALSE
  The total size of the 3 globals is 240 bytes (240 bytes)
  - globals: [3] '...future.x_ii', 'mu', 'sigma'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 1): 'stats'
  {
      {
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "error")
          {
              {
                  NULL
                  local({
                    for (pkg in "stats") {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      tryCatch({
          local({
              doFuture::registerDoFuture()
              lapply(seq_along(...future.x_ii), FUN = function(jj) {
                  ...future.x_jj <- ...future.x_ii[[jj]]
                  i <- NULL
                  ...future.env <- environment()
                  local({
                    for (name in names(...future.x_jj)) {
                      assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                        inherits = FALSE)
                    }
                  })
                  tryCatch({
                    library("stats")
                    {
                      set.seed(48879)
                      rnorm(i, mean = mu, sd = sigma)
                    }
                  }, error = identity)
              })
          })
      }, 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)
          }
      })
  }
  SequentialFuture started (and completed)
  Chunk #1 of 1 ... DONE
  Launching 1 futures (chunks) ... DONE
  - resolving future
  resolve() on list ...
   recursive: 0
   length: 1
  
   length: 0 (resolved future 1)
  resolve() on list ... DONE
  - collecting values of future
  - accumulating results
  - processing errors (handler = 'stop')
  - extracting results
  doFuture() ... DONE
  [[1]]
  [1] 2.178258
  
  [[2]]
  [1] 2.178258 1.461915
  
  [[3]]
  [1] 2.1782583 1.4619147 0.2247316
  
  Loading required package: plyr
  Warning in library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
    there is no package called 'plyr'
  Loading required package: BiocParallel
  Warning in library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
    there is no package called 'BiocParallel'
  - plan('sequential') ... DONE
  - plan('multicore') ...
  doFuture() ...
  - dummy globals (as locals): [1] 'i'
  - R expression:
  {
      doFuture::registerDoFuture()
      lapply(seq_along(...future.x_ii), FUN = function(jj) {
          ...future.x_jj <- ...future.x_ii[[jj]]
          i <- NULL
          ...future.env <- environment()
          local({
              for (name in names(...future.x_jj)) {
                  assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                    inherits = FALSE)
              }
          })
          tryCatch({
              library("stats")
              {
                  set.seed(48879)
                  rnorm(i, mean = mu, sd = sigma)
              }
          }, error = identity)
      })
  }
  - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals ...
  - globals found: [19] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'library', 'set.seed', 'rnorm', 'mu', 'sigma', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 153.08 KiB (156752 bytes)
  - globals: [3] '...future.x_ii', 'mu', 'sigma'
  - packages: [1] 'stats'
  getGlobalsAndPackages() ... DONE
    - globals: [3] '...future.x_ii', 'mu', 'sigma'
  List of 3
   $ ...future.x_ii: NULL
   $ mu            : num 1
   $ sigma         : num 2
   - attr(*, "where")=List of 3
    ..$ ...future.x_ii:<environment: 0x556c16c6ccf8> 
    ..$ mu            :<environment: R_GlobalEnv> 
    ..$ sigma         :<environment: R_GlobalEnv> 
   - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
   - attr(*, "resolved")= logi FALSE
   - attr(*, "total_size")= num 156752
    - packages: [1] 'stats'
    - R expression:
  {
      doFuture::registerDoFuture()
      lapply(seq_along(...future.x_ii), FUN = function(jj) {
          ...future.x_jj <- ...future.x_ii[[jj]]
          i <- NULL
          ...future.env <- environment()
          local({
              for (name in names(...future.x_jj)) {
                  assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                    inherits = FALSE)
              }
          })
          tryCatch({
              library("stats")
              {
                  set.seed(48879)
                  rnorm(i, mean = mu, sd = sigma)
              }
          }, error = identity)
      })
  }
  - identifying globals and packages ... DONE
  Number of chunks: 2
  Number of futures (= number of chunks): 2
  Launching 2 futures (chunks) ...
  Chunk #1 of 2 ...
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'mu', 'sigma'
  Resolving globals: FALSE
  The total size of the 3 globals is 144 bytes (144 bytes)
  - globals: [3] '...future.x_ii', 'mu', 'sigma'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 1): 'stats'
  {
      {
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "error")
          {
              {
                  {
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in "stats") {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      tryCatch({
          local({
              doFuture::registerDoFuture()
              lapply(seq_along(...future.x_ii), FUN = function(jj) {
                  ...future.x_jj <- ...future.x_ii[[jj]]
                  i <- NULL
                  ...future.env <- environment()
                  local({
                    for (name in names(...future.x_jj)) {
                      assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                        inherits = FALSE)
                    }
                  })
                  tryCatch({
                    library("stats")
                    {
                      set.seed(48879)
                      rnorm(i, mean = mu, sd = sigma)
                    }
                  }, error = identity)
              })
          })
      }, 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(constraints = "multicore"), 
                    earlySignal = FALSE, label = NULL, ...) 
                  {
                    if ("maxCores" %in% names(list(...))) {
                      .Defunct(msg = "Argument 'maxCores' has been renamed to 'workers'. Please update you script/code that uses the future package.")
                    }
                    if (substitute) 
                      expr <- substitute(expr)
                    workers <- as.integer(workers)
                    stopifnot(is.finite(workers), workers >= 1L)
                    if (workers == 1L || !supportsMulticore()) {
                      return(sequential(expr, envir = envir, substitute = FALSE, 
                        lazy = lazy, seed = seed, globals = globals, 
                        local = TRUE, label = label))
                    }
                    oopts <- options(mc.cores = workers)
                    on.exit(options(oopts))
                    future <- MulticoreFuture(expr = expr, envir = envir, 
                      substitute = FALSE, lazy = lazy, seed = seed, 
                      globals = globals, workers = workers, earlySignal = earlySignal, 
                      label = label, ...)
                    if (!future$lazy) 
                      future <- run(future)
                    invisible(future)
                  }), .cleanup = FALSE, .init = FALSE)
              }
              options(...future.oldOptions)
          }
      })
  }
  requestCore(): workers = 2
  MulticoreFuture started
  Chunk #1 of 2 ... DONE
  Chunk #2 of 2 ...
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'mu', 'sigma'
  Resolving globals: FALSE
  The total size of the 3 globals is 192 bytes (192 bytes)
  - globals: [3] '...future.x_ii', 'mu', 'sigma'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 1): 'stats'
  {
      {
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "error")
          {
              {
                  {
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in "stats") {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      tryCatch({
          local({
              doFuture::registerDoFuture()
              lapply(seq_along(...future.x_ii), FUN = function(jj) {
                  ...future.x_jj <- ...future.x_ii[[jj]]
                  i <- NULL
                  ...future.env <- environment()
                  local({
                    for (name in names(...future.x_jj)) {
                      assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                        inherits = FALSE)
                    }
                  })
                  tryCatch({
                    library("stats")
                    {
                      set.seed(48879)
                      rnorm(i, mean = mu, sd = sigma)
                    }
                  }, error = identity)
              })
          })
      }, 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(constraints = "multicore"), 
                    earlySignal = FALSE, label = NULL, ...) 
                  {
                    if ("maxCores" %in% names(list(...))) {
                      .Defunct(msg = "Argument 'maxCores' has been renamed to 'workers'. Please update you script/code that uses the future package.")
                    }
                    if (substitute) 
                      expr <- substitute(expr)
                    workers <- as.integer(workers)
                    stopifnot(is.finite(workers), workers >= 1L)
                    if (workers == 1L || !supportsMulticore()) {
                      return(sequential(expr, envir = envir, substitute = FALSE, 
                        lazy = lazy, seed = seed, globals = globals, 
                        local = TRUE, label = label))
                    }
                    oopts <- options(mc.cores = workers)
                    on.exit(options(oopts))
                    future <- MulticoreFuture(expr = expr, envir = envir, 
                      substitute = FALSE, lazy = lazy, seed = seed, 
                      globals = globals, workers = workers, earlySignal = earlySignal, 
                      label = label, ...)
                    if (!future$lazy) 
                      future <- run(future)
                    invisible(future)
                  }), .cleanup = FALSE, .init = FALSE)
              }
              options(...future.oldOptions)
          }
      })
  }
  requestCore(): workers = 2
  MulticoreFuture started
  Chunk #2 of 2 ... DONE
  Launching 2 futures (chunks) ... DONE
  - resolving future
  resolve() on list ...
   recursive: 0
   length: 2
  
   length: 1 (resolved future 1)
   length: 0 (resolved future 2)
  resolve() on list ... DONE
  - collecting values of future
  - accumulating results
  - processing errors (handler = 'stop')
  - extracting results
  doFuture() ... DONE
  [[1]]
  [1] 2.178258
  
  [[2]]
  [1] 2.178258 1.461915
  
  [[3]]
  [1] 2.1782583 1.4619147 0.2247316
  
  Loading required package: plyr
  Warning in library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
    there is no package called 'plyr'
  Loading required package: BiocParallel
  Warning in library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
    there is no package called 'BiocParallel'
  - plan('multicore') ... DONE
  - plan('multisession') ...
  plan(): plan_init() of 'multisession', 'cluster', 'multiprocess', 'future', 'function' ...
  multisession:
  - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), gc = FALSE, earlySignal = FALSE, label = NULL, ...)
  - tweaked: FALSE
  - call: plan(strategy)
  Workers: [n = 2] 'localhost', 'localhost'
  Warning in makeClusterPSOCK(workers, ...) : NAs introduced by coercion
  Base port: 11216
  Creating node 1 of 2 ...
  - setting up node
  Starting worker #1 on 'localhost': '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript' --default-packages=datasets,utils,grDevices,graphics,stats,methods -e 'parallel:::.slaveRSOCK()' MASTER=localhost PORT=11216 OUT=/dev/null TIMEOUT=2592000 XDR=TRUE
  Waiting for worker #1 on 'localhost' to connect back
  Warning in socketConnection("localhost", port = port, server = TRUE, blocking = TRUE,  :
    port 11216 cannot be opened
  Error in socketConnection("localhost", port = port, server = TRUE, blocking = TRUE,  : 
    cannot open the connection
  Calls: plan ... eval.parent -> eval -> eval -> eval -> eval -> socketConnection
  Execution halted