R Under development (unstable) (2025-08-24 r88696 ucrt) -- "Unsuffered Consequences" Copyright (C) 2025 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. > ## This runs testme test script inst/testme/test-globals,manual.R > ## Don't edit - it was autogenerated by inst/testme/deploy.R > future.batchtools:::testme("globals,manual") Test 'globals,manual' ... Sourcing 9 prologue scripts ... 01/09 prologue script 'D:/RCompile/CRANincoming/R-devel/lib/future.batchtools/testme/_prologue/001.load.R' 02/09 prologue script 'D:/RCompile/CRANincoming/R-devel/lib/future.batchtools/testme/_prologue/002.record-state.R' 03/09 prologue script 'D:/RCompile/CRANincoming/R-devel/lib/future.batchtools/testme/_prologue/030.imports.R' 04/09 prologue script 'D:/RCompile/CRANincoming/R-devel/lib/future.batchtools/testme/_prologue/050.utils.R' 05/09 prologue script 'D:/RCompile/CRANincoming/R-devel/lib/future.batchtools/testme/_prologue/090.context.R' 06/09 prologue script 'D:/RCompile/CRANincoming/R-devel/lib/future.batchtools/testme/_prologue/090.options.R' 07/09 prologue script 'D:/RCompile/CRANincoming/R-devel/lib/future.batchtools/testme/_prologue/091.envvars.R' 08/09 prologue script 'D:/RCompile/CRANincoming/R-devel/lib/future.batchtools/testme/_prologue/099.future-setup.R' 09/09 prologue script 'D:/RCompile/CRANincoming/R-devel/lib/future.batchtools/testme/_prologue/995.detrius-connections.R' Sourcing 9 prologue scripts ... done Running test script: 'D:/RCompile/CRANincoming/R-devel/lib/future.batchtools/testme/test-globals,manual.R' > library(future) > plan(future.batchtools::batchtools_local) > 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]) > attach_locally(globals) > 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) > rm(list = names(globals)) > y <- value(f) > print(y) [1] 8 > stopifnot(all.equal(y, v0)) > attach_locally(globals) > y %<-% { + x <- 1:10 + sumtwo(a + b * x) + } %globals% TRUE > rm(list = names(globals)) > print(y) [1] 8 > stopifnot(all.equal(y, v0)) > y %<-% { + 1 + } %globals% FALSE > print(y) [1] 1 > stopifnot(identical(y, 1)) > attach_locally(globals) > f <- future({ + x <- 1:10 + sumtwo(a + b * x) + }, globals = FALSE) > rm(list = names(globals)) > y <- tryCatch(value(f), error = identity) Warning in delete.BatchtoolsFuture(future) : Will not remove batchtools registry, because the status of the batchtools was 'error', 'defined', 'finished', 'started', 'submitted' and future backend argument 'delete' is 'on-success': 'D:/temp/2025_08_26_00_40_17_26176/RtmpumQo6b/.future/20250826_004206-umQo6b/batchtools_424322434' > if (!inherits(f, c("SequentialFuture", "MulticoreFuture"))) { + stopifnot(inherits(y, "simpleError")) + } > message("*** Globals - automatic ... DONE") *** Globals - automatic ... DONE > message("*** Globals manually specified as named list ...") *** Globals manually specified as named list ... > rm(list = names(globals)) Warning in rm(list = names(globals)) : object 'a' not found Warning in rm(list = names(globals)) : object 'b' not found Warning in rm(list = names(globals)) : object 'sumtwo' not found > f <- future({ + x <- 1:10 + sumtwo(a + b * x) + }, globals = globals) > v <- value(f) > print(v) [1] 8 > stopifnot(all.equal(v, v0)) > y %<-% { + x <- 1:10 + sumtwo(a + b * x) + } %globals% globals > print(y) [1] 8 > stopifnot(all.equal(y, v0)) > message("*** Globals manually specified as named list ... DONE") *** Globals manually specified as named list ... DONE > message("*** Globals manually specified by their names ...") *** Globals manually specified by their names ... > attach_locally(globals) > f <- future({ + x <- 1:10 + sumtwo(a + b * x) + }, globals = c("a", "b", "sumtwo")) > rm(list = names(globals)) > v <- value(f) > print(v) [1] 8 > stopifnot(all.equal(v, v0)) > attach_locally(globals) > y %<-% { + x <- 1:10 + sumtwo(a + b * x) + } %globals% c("a", "b", "sumtwo") > rm(list = names(globals)) > print(y) [1] 8 > stopifnot(all.equal(y, v0)) > message("*** Globals manually specified by their names ... DONE") *** Globals manually specified by their names ... DONE > message("*** Globals - manually ... DONE") *** Globals - manually ... DONE Sourcing 6 epilogue scripts ... 01/06 epilogue script 'D:/RCompile/CRANincoming/R-devel/lib/future.batchtools/testme/_epilogue/001.undo-future.R' 02/06 epilogue script 'D:/RCompile/CRANincoming/R-devel/lib/future.batchtools/testme/_epilogue/002.undo-state.R' Failed to undo environment variables: - Expected environment variables: [n=214] '!ExitCode', 'ALLUSERSPROFILE', 'APPDATA', ..., 'tempdirname' - Environment variables still there: [n=0] - Environment variables missing: [n=1] 'MAKEFLAGS' Differences environment variable by environment variable: 03/06 epilogue script 'D:/RCompile/CRANincoming/R-devel/lib/future.batchtools/testme/_epilogue/090.gc.R' 04/06 epilogue script 'D:/RCompile/CRANincoming/R-devel/lib/future.batchtools/testme/_epilogue/099.session_info.R' 05/06 epilogue script 'D:/RCompile/CRANincoming/R-devel/lib/future.batchtools/testme/_epilogue/995.detritus-connections.R' 06/06 epilogue script 'D:/RCompile/CRANincoming/R-devel/lib/future.batchtools/testme/_epilogue/999.detritus-files.R' Skipping, because path appears not to be an 'R CMD check' folder: 'D:/temp/2025_08_26_00_40_17_26176' Sourcing 6 epilogue scripts ... done Test time: user.self=1s, sys.self=0.1s, elapsed=7s, user.child=NAs, sys.child=NAs Test 'tempdirname' ... success > > proc.time() user system elapsed 1.62 0.28 8.04 Warning message: In delete.BatchtoolsFuture(f, onRunning = "skip", onMissing = "ignore", : Will not remove batchtools registry, because the status of the batchtools was 'error', 'defined', 'finished', 'started', 'submitted' and future backend argument 'delete' is 'on-success': 'D:/temp/2025_08_26_00_40_17_26176/RtmpumQo6b/.future/20250826_004206-umQo6b/batchtools_424322434'