R version 4.6.0 RC (2026-04-22 r89945 ucrt) -- "Because it was There" Copyright (C) 2026 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > #! /usr/bin/env Rscript > ## This runs testme test script inst/testme/test-nbrOfWorkers.R > ## Don't edit - it was autogenerated by inst/testme/deploy.R > future.batchtools:::testme("nbrOfWorkers") Test 'nbrOfWorkers' ... chr "none" > library(future) > message("*** nbrOfWorkers() ...") *** nbrOfWorkers() ... > message("*** nbrOfWorkers() - local, interactive ...") *** nbrOfWorkers() - local, interactive ... > plan(future.batchtools::batchtools_local) > n <- nbrOfWorkers() > message("Number of workers: ", n) Number of workers: 1 > stopifnot(n == 1) > n <- nbrOfFreeWorkers() > message("Number of free workers: ", n) Number of free workers: 1 > stopifnot(n == 1) > n <- nbrOfFreeWorkers(background = TRUE) > message("Number of free background workers: ", n) Number of free background workers: 0 > stopifnot(n == 0) > plan(future.batchtools::batchtools_interactive) > n <- nbrOfWorkers() > message("Number of workers: ", n) Number of workers: 1 > stopifnot(n == 1) > n <- nbrOfFreeWorkers() > message("Number of free workers: ", n) Number of free workers: 1 > stopifnot(n == 1) > n <- nbrOfFreeWorkers(background = TRUE) > message("Number of free background workers: ", n) Number of free background workers: 0 > stopifnot(n == 0) > message("*** nbrOfWorkers() - local, interactive ... DONE") *** nbrOfWorkers() - local, interactive ... DONE > ncores <- availableCores("multicore") > if (ncores >= 2) { + message("*** nbrOfWorkers() - multicore ...") + n <- plan(future.batchtools::batchtools_multicore) + n <- nbrOfWork .... [TRUNCATED] > message("*** nbrOfWorkers() - custom ...") *** nbrOfWorkers() - custom ... > cf <- batchtools::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 0 $ hooks : list() - attr(*, "class")= chr "ClusterFunctions" > plan(future.batchtools::batchtools_custom, workers = 1, + cluster.functions = cf) Warning in tweak.future(base::quote(function (...) : Detected 2 unknown future arguments: 'workers', 'cluster.functions' > n <- nbrOfWorkers() > message("Number of workers: ", n) Number of workers: 1 > stopifnot(n == 1) > message("*** nbrOfWorkers() - custom ... DONE") *** nbrOfWorkers() - custom ... DONE > message("*** nbrOfWorkers() ... DONE") *** nbrOfWorkers() ... DONE Failed to undo environment variables: - Expected environment variables: [n=220] '!ExitCode', 'ALLUSERSPROFILE', 'APPDATA', ..., 'tempdirname' - Environment variables still there: [n=0] - Environment variables missing: [n=1] 'MAKEFLAGS' Differences environment variable by environment variable: Skipping, because path appears not to be an 'R CMD check' folder: 'D:/temp/2026_04_25_00_50_17_18966' Test time: user.self=0.2s, sys.self=0.02s, elapsed=0.2s, user.child=NAs, sys.child=NAs Test 'tempdirname' ... success > > proc.time() user system elapsed 1.17 0.12 1.28