Running ‘foreach_dofuture,cluster-missing-doFuture-pkg.R’ [1s/2s]
  Running ‘foreach_dofuture,errors.R’ [6s/18s]
  Running ‘foreach_dofuture,globals.R’ [4s/12s]
  Running ‘foreach_dofuture,nested_colon.R’ [7s/22s]
  Running ‘foreach_dofuture,nested_dofuture.R’ [6s/29s]
  Running ‘foreach_dofuture,rng.R’ [3s/7s]
  Running ‘foreach_dofuture.R’ [2s/5s]
  Running ‘foreach_dopar,cluster-missing-doFuture-pkg.R’ [1s/3s]
  Running ‘foreach_dopar,doRNG,dopar.R’ [2s/4s]
  Running ‘foreach_dopar,doRNG,dorng.R’ [4s/10s]
  Running ‘foreach_dopar,errors.R’ [3s/13s]
  Running ‘foreach_dopar,globals.R’ [4s/12s]
  Running ‘foreach_dopar,nested_colon.R’ [5s/18s]
  Running ‘foreach_dopar,nested_dopar.R’ [7s/30s]
  Running ‘foreach_dopar,options-for-export.R’ [3s/6s]
  Running ‘foreach_dopar.R’ [2s/5s]
  Running ‘makeChunks.R’ [4s/6s]
  Running ‘options,nested.R’ [5s/10s]
  Running ‘registerDoFuture.R’ [1s/3s]
  Running ‘times.R’ [1s/3s]
  Running ‘utils.R’ [1s/1s]
  Running ‘withDoRNG.R’ [2s/5s]
Running the tests in ‘tests/foreach_dofuture,cluster-missing-doFuture-pkg.R’ failed.
Complete output:
  > source("incl/start.R")
  Loading required package: foreach
  Loading required package: future
  R version 4.4.1 Patched (2024-08-05 r86980)
  Platform: x86_64-pc-linux-gnu
  Running under: Debian GNU/Linux trixie/sid
  
  Matrix products: default
  BLAS:   /home/hornik/tmp/R.check/r-patched-gcc/Work/build/lib/libRblas.so 
  LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.12.0
  
  locale:
   [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
   [4] LC_COLLATE=C           LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
   [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
  [10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   
  
  time zone: Europe/Vienna
  tzcode source: system (glibc)
  
  attached base packages:
  [1] stats     graphics  grDevices utils     datasets  methods   base     
  
  other attached packages:
  [1] doFuture_1.0.1 future_1.34.0  foreach_1.5.2 
  
  loaded via a namespace (and not attached):
   [1] compiler_4.4.1      parallelly_1.38.0   tools_4.4.1        
   [4] parallel_4.4.1      future.apply_1.11.2 listenv_0.9.1      
   [7] codetools_0.2-20    iterators_1.0.14    digest_0.6.37      
  [10] globals_0.16.3     
  > options(future.debug = FALSE)
  > 
  > message("*** cluster() ...")
  *** cluster() ...
  > 
  > message("Library paths: ", paste(sQuote(.libPaths()), collapse = ", "))
  Library paths: '/home/hornik/tmp/scratch/Rtmp9IbzDu/RLIBS_26c4ed4a5f4e36', '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/library'
  > message("Package path: ", sQuote(system.file(package = "future")))
  Package path: '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/Packages/future'
  > 
  > types <- "PSOCK"
  > #if (supportsMulticore()) types <- c(types, "FORK")
  > 
  > setupClusterWithoutPkgs <- function(type = "PSOCK",
  +                                     withs = c("digest", "globals",
  +                                               "listenv", "future"),
  +                                     withouts = c("doFuture")) {
  +   cl <- parallel::makeCluster(1L, type = type, timeout = 60)
  + 
  +   ## Emulate a worker that does not have 'future' installed.
  +   ## by setting a different user library path on the worker.
  +   libs <- parallel::clusterEvalQ(cl, .libPaths(tempdir()))[[1]]
  +   attr(cl, "libs") <- libs
  + 
  +   ## 'withouts' tops 'withs' for conveniency
  +   withs <- setdiff(withs, withouts)
  +   
  +   ## "Install" any 'withs' packages?
  +   if (length(withs) > 0L) {
  +     paths <- find.package(withs)
  +     res <- parallel::clusterCall(cl, fun = sapply, X = paths,
  +                                  FUN = file.copy, to = libs[1],
  +                                  recursive = TRUE)[[1]]
  +     res <- parallel::clusterCall(cl, fun = sapply, X = withs,
  +                                  FUN = requireNamespace)[[1]]
  +   }
  +   attr(cl, "withs") <- res
  + 
  +   ## Check whether 'future' is still available on the worker or not.
  +   ## It could be that it is installed in the system library path, which
  +   ## in case we cannot "hide" the future package from the worker.
  +   res <- parallel::clusterCall(cl, fun = sapply, X = withouts,
  +                                    FUN = requireNamespace)[[1]]
  +   attr(cl, "withouts") <- res
  + 
  +   cl
  + }
  > 
  > cl <- NULL
  > for (type in types) {
  +   message(sprintf("Test set #1 with cluster type %s ...", sQuote(type)))
  + 
  +   cl <- setupClusterWithoutPkgs(type, withouts = c("future", "doFuture"))  
  +   if (all(attr(cl, "withs")) && !all(attr(cl, "withouts"))) {
  +     plan(cluster, workers = cl, .init = FALSE)
  +     
  +     ## Here we will get:
  +     ##   <UnexpectedFutureResultError: Unexpected result (of class
  +     ##   'snow-try-error' != 'FutureResult') retrieved for ClusterFuture
  +     ##   future (label = '<none>', expression = '{ ... }'):
  +     ##   Package 'future' is not installed on worker (r_version: ...)>
  +     ## Note: This error is produced by the future backend when it recieves
  +     ##       the unexpected results.
  +     res <- tryCatch({
  +       y <- foreach(ii = 1:3) %dofuture% ii
  +     }, error = identity)
  +     print(res)
  +     stopifnot(inherits(res, "FutureError"))
  +   }
  +   parallel::stopCluster(cl)
  +   cl <- NULL
  +   
  +   cl <- setupClusterWithoutPkgs(type)  
  +   if (all(attr(cl, "withs")) && !all(attr(cl, "withouts"))) {
  +     plan(cluster, workers = cl, .init = FALSE)
  +     
  +     ## Here we will get:
  +     ##   <UnexpectedFutureResultError: Unexpected result (of class
  +     ##   'snow-try-error' != 'FutureResult') retrieved for ClusterFuture
  +     ##   future (label = '<none>', expression = '{ ... }'):
  +     ##   there is no package called 'doFuture'>
  +     ## Note: This error is produced by the future backend when it recieves
  +     ##       the unexpected results.
  +     res <- tryCatch({
  +       y <- foreach(ii = 1:3) %dofuture% ii
  +     }, error = identity)
  +     print(res)
  +     stopifnot(inherits(res, "FutureError"))
  +   }
  +   parallel::stopCluster(cl)
  +   cl <- NULL
  +   
  +   plan(sequential)
  +   
  +   message(sprintf("Test set #1 with cluster type %s ... DONE", sQuote(type)))
  + } ## for (type ...)
  Test set #1 with cluster type 'PSOCK' ...
  [21:56:37.021] doFuture2() ...
  [21:56:37.028] Number of chunks: 1
  [21:56:37.028] Number of futures (= number of chunks): 1
  [21:56:37.028] seed = FALSE
  [21:56:37.029]  NULL
  [21:56:37.037] seed = FALSE
  [21:56:37.038] seed = FALSE
  [21:56:37.038] - foreach iterator arguments: [1] 'ii'
  [21:56:37.038] - dummy globals (as locals): [1] 'ii'
  [21:56:37.039] - R expression:
  [21:56:37.039] {
  [21:56:37.039]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [21:56:37.039]         ...future.x_jj <- ...future.x_ii[[jj]]
  [21:56:37.039]         {
  [21:56:37.039]             NULL
  [21:56:37.039]             ii <- NULL
  [21:56:37.039]         }
  [21:56:37.039]         ...future.env <- environment()
  [21:56:37.039]         local({
  [21:56:37.039]             for (name in names(...future.x_jj)) {
  [21:56:37.039]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [21:56:37.039]                   inherits = FALSE)
  [21:56:37.039]             }
  [21:56:37.039]         })
  [21:56:37.039]         tryCatch(ii, error = identity)
  [21:56:37.039]     })
  [21:56:37.039] }
  [21:56:37.040] function (ii) 
  [21:56:37.040] {
  [21:56:37.040]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [21:56:37.040]         ...future.x_jj <- ...future.x_ii[[jj]]
  [21:56:37.040]         {
  [21:56:37.040]             NULL
  [21:56:37.040]             ii <- NULL
  [21:56:37.040]         }
  [21:56:37.040]         ...future.env <- environment()
  [21:56:37.040]         local({
  [21:56:37.040]             for (name in names(...future.x_jj)) {
  [21:56:37.040]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [21:56:37.040]                   inherits = FALSE)
  [21:56:37.040]             }
  [21:56:37.040]         })
  [21:56:37.040]         tryCatch(ii, error = identity)
  [21:56:37.040]     })
  [21:56:37.040] }
  [21:56:37.044] - identifying globals and packages ...
  [21:56:37.045]  logi TRUE
  [21:56:37.045]  - attr(*, "add")= chr "...future.x_ii"
  [21:56:37.045]  - attr(*, "ignore")= chr "ii"
  [21:56:37.102] List of 1
  [21:56:37.102]  $ ...future.x_ii: num 42
  [21:56:37.102]  - attr(*, "where")=List of 1
  [21:56:37.102]   ..$ ...future.x_ii:<environment: R_EmptyEnv> 
  [21:56:37.102]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [21:56:37.102]  - attr(*, "resolved")= logi FALSE
  [21:56:37.102]  - attr(*, "total_size")= int 39
  [21:56:37.111]   - R expression:
  [21:56:37.111] {
  [21:56:37.111]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [21:56:37.111]         ...future.x_jj <- ...future.x_ii[[jj]]
  [21:56:37.111]         {
  [21:56:37.111]             NULL
  [21:56:37.111]             ii <- NULL
  [21:56:37.111]         }
  [21:56:37.111]         ...future.env <- environment()
  [21:56:37.111]         local({
  [21:56:37.111]             for (name in names(...future.x_jj)) {
  [21:56:37.111]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [21:56:37.111]                   inherits = FALSE)
  [21:56:37.111]             }
  [21:56:37.111]         })
  [21:56:37.111]         tryCatch(ii, error = identity)
  [21:56:37.111]     })
  [21:56:37.111] }
  [21:56:37.116]   - globals: [1] '...future.x_ii'
  [21:56:37.116] List of 1
  [21:56:37.116]  $ ...future.x_ii: num 42
  [21:56:37.116]  - attr(*, "where")=List of 1
  [21:56:37.116]   ..$ ...future.x_ii:<environment: R_EmptyEnv> 
  [21:56:37.116]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [21:56:37.116]  - attr(*, "resolved")= logi FALSE
  [21:56:37.116]  - attr(*, "total_size")= int 39
  [21:56:37.135]   - packages: [1] 'doFuture'
  [21:56:37.136] - identifying globals and packages ... DONE
  [21:56:37.140] Launching 1 futures (chunks) ...
  [21:56:37.140] Chunk #1 of 1 ...
  [21:56:37.141]  - Finding globals in 'args_list' chunk #1 ...
  [21:56:37.142] 
  [21:56:37.142] 
  [21:56:37.142]  - Finding globals in 'args_list' for chunk #1 ... DONE
  [21:56:37.142]  - seeds: <none>
  [21:56:37.156] Chunk #1 of 1 ... DONE
  [21:56:37.156] Launching 1 futures (chunks) ... DONE
  [21:56:37.156] - resolving futures
  [21:56:37.156]   - gathering results & relaying conditions (except errors)
  <FutureError: Package 'future' is not installed on worker (r_version: 4.4.1 Patched (2024-08-05 r86980); platform: x86_64-pc-linux-gnu (64-bit); os: Linux 6.10.11-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.10.11-1 (2024-09-22); hostname: gimli2)>
  
  
  Future UUID: e9141f92-4a78-6ad2-74c9-aabed4d18cf1
  
  
  DEBUG: BEGIN TROUBLESHOOTING HELP
  Future involved:
  ClusterFuture:
  Label: 'doFuture2-1'
  Expression:
  {
      lapply(seq_along(...future.x_ii), FUN = function(jj) {
          ...future.x_jj <- ...future.x_ii[[jj]]
          {
              NULL
              ii <- NULL
          }
          ...future.env <- environment()
          local({
              for (name in names(...future.x_jj)) {
                  assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                    inherits = FALSE)
              }
          })
          tryCatch(ii, error = identity)
      })
  }
  Lazy evaluation: FALSE
  Asynchronous evaluation: TRUE
  Local evaluation: TRUE
  Environment: R_GlobalEnv
  Capture standard output: TRUE
  Capture condition classes: 'condition' (excluding 'nothing')
  Globals: 1 objects totaling 194 bytes (list '...future.x_ii' of 194 bytes)
  Packages: 1 packages ('doFuture')
  L'Ecuyer-CMRG RNG seed: <none> (seed = FALSE)
  Resolved: TRUE
  Value: <not collected>
  Conditions captured: <none>
  Early signaling: FALSE
  Owner process: 15585d88-35ca-27a6-6004-7e96126bcd9a
  Class: 'ClusterFuture', 'MultiprocessFuture', 'Future', 'environment'
  
  DEBUG: END TROUBLESHOOTING HELP
  Error in serverSocket(port = port) : 
    creation of server socket failed: port 11262 cannot be opened
  Calls: setupClusterWithoutPkgs -> <Anonymous> -> makePSOCKcluster -> serverSocket
  Execution halted