R Under development (unstable) (2025-06-05 r88281 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. > source("incl/start.R") Loading required package: parallelly Loading required package: future > > message("*** BatchtoolsFuture() ...") *** BatchtoolsFuture() ... > > message("*** BatchtoolsFuture() - cleanup ...") *** BatchtoolsFuture() - cleanup ... > > f <- batchtools_local({ 1L }) [04:36:50.398] Launched future #1 > res <- await(f, cleanup = TRUE) > print(res) FutureResult: value: 'integer' visible: TRUE stdout: character conditions: [n = 0] RNG used: FALSE duration: 0.07944989 secs (started 2025-06-06 04:36:50.258239) version: 1.8 > stopifnot(res$value == 1L) > > message("*** BatchtoolsFuture() - cleanup ... DONE") *** BatchtoolsFuture() - cleanup ... DONE > > > message("*** BatchtoolsFuture() - deleting exceptions ...") *** BatchtoolsFuture() - deleting exceptions ... > > ## Printing a deleted future > f <- batchtools_local(42L) [04:36:51.852] Launched future #1 > print(f) BatchtoolsLocalFuture: Label: Expression: [1] 42 Globals: Packages: L'Ecuyer-CMRG RNG seed: (seed = FALSE) Capture standard output: TRUE Capture condition classes: 'condition' (excluding '') Immediate condition classes: 'immediateCondition' Lazy evaluation: FALSE Local evaluation: TRUE Asynchronous evaluation: TRUE Early signaling: FALSE Environment: R_GlobalEnv State: 'running' Resolved: TRUE Unique identifier: ba91b4f1bdcb6750f42f18aaca2d206b-2 Owner process: ba91b4f1bdcb6750f42f18aaca2d206b Class: 'BatchtoolsLocalFuture', 'BatchtoolsUniprocessFuture', 'BatchtoolsFuture', 'Future', 'environment' Value: Conditions captured: batchtools configuration file: 'D:/RCompile/CRANincoming/R-devel/lib/future.batchtools/templates-for-R_CMD_check/batchtools.conf.R' (82 bytes; 1 lines) batchtools cluster functions: 'Interactive' batchtools cluster functions template: batchtools status: 'defined', 'finished', 'started', 'submitted' batchtools Registry: File dir exists: TRUE Work dir exists: TRUE Job Registry Backend : Interactive File dir : D:/temp/2025_06_06_04_35_16_24916/RtmpWELwDj/.future/20250606_043649-WELwDj/batchtools_1187045613 Work dir : D:/RCompile/CRANincoming/R-devel/future.batchtools.Rcheck/tests Jobs : 1 Seed : 30703 Writeable: TRUE > v <- value(f) > print(v) [1] 42 > stopifnot(v == 42L) > res <- delete(f) > print(f) BatchtoolsLocalFuture: Label: Expression: [1] 42 Globals: Packages: L'Ecuyer-CMRG RNG seed: (seed = FALSE) Capture standard output: TRUE Capture condition classes: 'condition' (excluding '') Immediate condition classes: 'immediateCondition' Lazy evaluation: FALSE Local evaluation: TRUE Asynchronous evaluation: TRUE Early signaling: FALSE Environment: R_GlobalEnv State: 'finished' Resolved: TRUE Unique identifier: ba91b4f1bdcb6750f42f18aaca2d206b-2 Owner process: ba91b4f1bdcb6750f42f18aaca2d206b Class: 'BatchtoolsLocalFuture', 'BatchtoolsUniprocessFuture', 'BatchtoolsFuture', 'Future', 'environment' Value: 35 bytes of class 'integer' Duration: 0.06738901 secs (started 2025-06-06 04:36:51.636238) Worker process: ba666245d92bca3b62904270c340bc02 batchtools configuration file: 'D:/RCompile/CRANincoming/R-devel/lib/future.batchtools/templates-for-R_CMD_check/batchtools.conf.R' (82 bytes; 1 lines) batchtools cluster functions: 'Interactive' batchtools cluster functions template: batchtools status: 'defined', 'finished', 'started', 'submitted' batchtools Registry: File dir exists: FALSE Work dir exists: TRUE Job Registry Backend : Interactive File dir : D:/temp/2025_06_06_04_35_16_24916/RtmpWELwDj/.future/20250606_043649-WELwDj/batchtools_1187045613 Work dir : D:/RCompile/CRANincoming/R-devel/future.batchtools.Rcheck/tests Jobs : 1 Seed : 30703 Writeable: TRUE > res <- delete(f) > print(f) BatchtoolsLocalFuture: Label: Expression: [1] 42 Globals: Packages: L'Ecuyer-CMRG RNG seed: (seed = FALSE) Capture standard output: TRUE Capture condition classes: 'condition' (excluding '') Immediate condition classes: 'immediateCondition' Lazy evaluation: FALSE Local evaluation: TRUE Asynchronous evaluation: TRUE Early signaling: FALSE Environment: R_GlobalEnv State: 'finished' Resolved: TRUE Unique identifier: ba91b4f1bdcb6750f42f18aaca2d206b-2 Owner process: ba91b4f1bdcb6750f42f18aaca2d206b Class: 'BatchtoolsLocalFuture', 'BatchtoolsUniprocessFuture', 'BatchtoolsFuture', 'Future', 'environment' Value: 35 bytes of class 'integer' Duration: 0.06738901 secs (started 2025-06-06 04:36:51.636238) Worker process: ba666245d92bca3b62904270c340bc02 batchtools configuration file: 'D:/RCompile/CRANincoming/R-devel/lib/future.batchtools/templates-for-R_CMD_check/batchtools.conf.R' (82 bytes; 1 lines) batchtools cluster functions: 'Interactive' batchtools cluster functions template: batchtools status: 'defined', 'finished', 'started', 'submitted' batchtools Registry: File dir exists: FALSE Work dir exists: TRUE Job Registry Backend : Interactive File dir : D:/temp/2025_06_06_04_35_16_24916/RtmpWELwDj/.future/20250606_043649-WELwDj/batchtools_1187045613 Work dir : D:/RCompile/CRANincoming/R-devel/future.batchtools.Rcheck/tests Jobs : 1 Seed : 30703 Writeable: TRUE > > message("*** BatchtoolsFuture() - deleting exceptions ... DONE") *** BatchtoolsFuture() - deleting exceptions ... DONE > > > message("*** BatchtoolsFuture() - registry exceptions ...") *** BatchtoolsFuture() - registry exceptions ... > > ## Non-existing batchtools registry > f <- BatchtoolsFuture({ x <- 1 }) > > ## Hack to emulate where batchtools registry is deleted or fails > f$state <- "running" > if (!is.null(f$config$reg)) { + path <- f$config$reg$file.dir + unlink(path, recursive = TRUE) + } > > res <- tryCatch({ + value(f) + }, error = function(ex) ex) > print(res) ') of class 'BatchtoolsFuture', 'Future', 'environment'> > stopifnot(inherits(res, "error")) > > res <- tryCatch({ + await(f) + }, error = function(ex) ex) > print(res) > stopifnot(inherits(res, "error")) > > > message("*** BatchtoolsFuture() - registry exceptions ... DONE") *** BatchtoolsFuture() - registry exceptions ... DONE > > message("*** BatchtoolsFuture() - exceptions ...") *** BatchtoolsFuture() - exceptions ... > > res <- try(f <- BatchtoolsFuture(42L, workers = integer(0)), silent = TRUE) > print(res) [1] "Error : 'length(workers) >= 1' is not TRUE\n" attr(,"class") [1] "try-error" attr(,"condition") = 1' is not TRUE> > stopifnot(inherits(res, "try-error")) > > res <- try(f <- BatchtoolsFuture(42L, workers = 0L), silent = TRUE) > print(res) [1] "Error : 'workers >= 1' is not TRUE\n" attr(,"class") [1] "try-error" attr(,"condition") = 1' is not TRUE> > stopifnot(inherits(res, "try-error")) > > res <- try(f <- BatchtoolsFuture(42L, workers = TRUE), silent = TRUE) > print(res) [1] "Error in as_BatchtoolsFuture(future, resources = resources, workers = workers, : \n Argument 'workers' should be either a numeric or a function: logical\n" attr(,"class") [1] "try-error" attr(,"condition") > stopifnot(inherits(res, "try-error")) > > message("*** BatchtoolsFuture() - exceptions ... DONE") *** BatchtoolsFuture() - exceptions ... DONE > > > message("*** BatchtoolsFuture() - timeout ...") *** BatchtoolsFuture() - timeout ... > > if (fullTest && availableCores(constraints = "multicore") > 1) { + plan(batchtools_multicore) + + options(future.wait.timeout = 0.15, future.wait.interval = 0.1) + + f <- future({ + Sys.sleep(5) + x <- 1 + }) + + res <- tryCatch({ + value(f) + }, error = function(ex) ex) + stopifnot(inherits(res, "error")) + } > > > message("*** BatchtoolsFuture() - timeout ... DONE") *** BatchtoolsFuture() - timeout ... DONE > > > > message("*** BatchtoolsFuture() ... DONE") *** BatchtoolsFuture() ... DONE > > source("incl/end.R") > > proc.time() user system elapsed 1.53 0.32 4.28