R version 4.5.0 beta (2025-03-29 r88074 ucrt) -- "How About a Twenty-Six" 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. > check <- future.tests::check > > message("*** check() ...") *** check() ... > > ## Validate options > check() Usage: Rscript -e future.tests::check --args Options: --version Version of package --help Display this help --test-timeout= Sets per-test timeout in seconds --test-tags= Comma-separated tags specifying tests to include --test-plan= Future plan to test against --session-info Output session information at the end Examples: Rscript -e future.tests::check --args --help Rscript -e future.tests::check --args --test-plan=sequential Rscript -e future.tests::check --args --test-plan=multisession,workers=4 Rscript -e future.tests::check --args --test-plan=future.callr::callr Rscript -e future.tests::check --args --test-plan=future.batchtools::batchtools_local > check(.args = c("--debug", "--help")) Usage: Rscript -e future.tests::check --args Options: --version Version of package --help Display this help --test-timeout= Sets per-test timeout in seconds --test-tags= Comma-separated tags specifying tests to include --test-plan= Future plan to test against --session-info Output session information at the end Examples: Rscript -e future.tests::check --args --help Rscript -e future.tests::check --args --test-plan=sequential Rscript -e future.tests::check --args --test-plan=multisession,workers=4 Rscript -e future.tests::check --args --test-plan=future.callr::callr Rscript -e future.tests::check --args --test-plan=future.batchtools::batchtools_local > > ## Run checks with plan(sequential) > results <- check(plan = "sequential", session_info = TRUE, debug = TRUE) ── Settings ──────────────────────────────────────────────────────────────────── - future.tests version : 0.8.0 - R_FUTURE_TESTS_ROOT : - Option 'future.tests.root': NULL - Default test set folder : D:/RCompile/CRANincoming/R-devel/lib/future.tests/test-db - Max number of workers : 2 - Timeout : N/A ── Running 55 test sets with plan(sequential) ────────────────────────────────── ℹ Backend package: future 1.34.0 - future() - conditions \ future() - conditions (1/1) ✔ 1. future() - conditions (1 test) (175ms) - %<-% - conditions \ %<-% - conditions (1/1) ✔ 2. %<-% - conditions (1 test) (60ms) - future() - muffle conditions \ future() - muffle conditions (1/1) ✔ 3. future() - muffle conditions (1 test) (78ms) - Argument '...' \ Argument '...' (1/1) ✔ 4. Argument '...' (1 test) (12ms) - Argument '...' from parent function \ Argument '...' from parent function (1/1) ✔ 5. Argument '...' from parent function (1 test) (7ms) - Argument '...' - non existing \ Argument '...' - non existing (1/1) ✔ 6. Argument '...' - non existing (1 test) (8ms) - Argument '...' - exception \ Argument '...' - exception (1/1) ✔ 7. Argument '...' - exception (1 test) (11ms) - Early signaling of errors \ Early signaling of errors (1/4) | Early signaling of errors (2/4) / Early signaling of errors (3/4) - Early signaling of errors (4/4) ✔ 8. Early signaling of errors (4 tests) (34ms) - Early signaling of warnings \ Early signaling of warnings (1/4) | Early signaling of warnings (2/4) / Early signaling of warnings (3/4) - Early signaling of warnings (4/4) ✔ 9. Early signaling of warnings (4 tests) (25ms) - Early signaling of messages \ Early signaling of messages (1/4) | Early signaling of messages (2/4) / Early signaling of messages (3/4) - Early signaling of messages (4/4) ✔ 10. Early signaling of messages (4 tests) (33ms) - futureAssign() - lazy evaluation \ futureAssign() - lazy evaluation (1/2) | futureAssign() - lazy evaluation (2/2) ✔ 11. futureAssign() - lazy evaluation (2 tests) (14ms) - futureAssign() - potential task name clashes \ futureAssign() - potential task name clashes (1/1) ✔ 12. futureAssign() - potential task name clashes (1 test) (15ms) - futureAssign() - global variables with and without lazy evaluation \ futureAssign() - global variables with and without lazy evaluation (1/2) | futureAssign() - global variables with and without lazy evaluation (2/2) ✔ 13. futureAssign() - global variables with and without lazy evaluation (2 tests) (39ms) - futureAssign() - lazy evaluation via disposable option \ futureAssign() - lazy evaluation via disposable option (1/2) | futureAssign() - lazy evaluation via disposable option (2/2) ✔ 14. futureAssign() - lazy evaluation via disposable option (2 tests) (19ms) - %<-% - local evaluation \ %<-% - local evaluation (1/2) | %<-% - local evaluation (2/2) ✔ 15. %<-% - local evaluation (2 tests) (16ms) - %<-% - local evaluation & global variable \ %<-% - local evaluation & global variable (1/2) | %<-% - local evaluation & global variable (2/2) ✔ 16. %<-% - local evaluation & global variable (2 tests) (16ms) - %<-% - errors \ %<-% - errors (1/2) | %<-% - errors (2/2) ✔ 17. %<-% - errors (2 tests) (18ms) - %<-% - errors and listenv \ %<-% - errors and listenv (1/2) | %<-% - errors and listenv (2/2) ✔ 18. %<-% - errors and listenv (2 tests) (69ms) - %<-% & %->% \ %<-% & %->% (1/2) | %<-% & %->% (2/2) ✔ 19. %<-% & %->% (2 tests) (20ms) - %<-% - nested \ %<-% - nested (1/1) ✔ 20. %<-% - nested (1 test) (27ms) - futureCall() \ futureCall() (1/4) | futureCall() (2/4) / futureCall() (3/4) - futureCall() (4/4) ✔ 21. futureCall() (4 tests) (98ms) - futureCall() - globals = list(a = 3) \ futureCall() - globals = list(a = 3) (1/2) | futureCall() - globals = list(a = 3) (2/2) ✔ 22. futureCall() - globals = list(a = 3) (2 tests) (25ms) - futureCall() - globals = "a" \ futureCall() - globals = "a" (1/2) | futureCall() - globals = "a" (2/2) ✔ 23. futureCall() - globals = "a" (2 tests) (16ms) - future() - rm() a global variable \ future() - rm() a global variable (1/2) | future() - rm() a global variable (2/2) ✔ 24. future() - rm() a global variable (2 tests) (21ms) - future() - non-exported package objects \ future() - non-exported package objects (1/1) ✔ 25. future() - non-exported package objects (1 test) (73ms) - future() - NSE '...' \ future() - NSE '...' (1/1) ✔ 26. future() - NSE '...' (1 test) (15ms) - future() - global variables with and without lazy evaluation \ future() - global variables with and without lazy evaluation (1/2) | future() - global variables with and without lazy evaluation (2/2) ✔ 27. future() - global variables with and without lazy evaluation (2 tests) (18ms) - resolved() on lazy futures \ resolved() on lazy futures (1/1) ✔ 28. resolved() on lazy futures (1 test) (7ms) - demo("mandelbrot", package = "future") \ demo("mandelbrot", package = "future") (1/2) | demo("mandelbrot", package = "future") (2/2) ✔ 29. demo("mandelbrot", package = "future") (2 tests) (483ms) - nbrOfWorkers() \ nbrOfWorkers() (1/1) ✔ 30. nbrOfWorkers() (1 test) (1ms) - future() - preserve R options (data.table) \ future() - preserve R options (data.table) (1/1) ✔ 31. future() - preserve R options (data.table) (1 test) (117ms) - future() - 'data.table' inject \ future() - 'data.table' inject (1/1) ✔ 32. future() - 'data.table' inject (1 test) (33ms) - future() - can load 'ff' package \ future() - can load 'ff' package (1/1) ✔ 33. future() - can load 'ff' package (1 test) (55ms) - future() - can attach 'ff' package \ future() - can attach 'ff' package (1/1) ✔ 34. future() - can attach 'ff' package (1 test) (58ms) - future() - preserve R options (ff) \ future() - preserve R options (ff) (1/1) ✔ 35. future() - preserve R options (ff) (1 test) (57ms) - plan() \ plan() (1/1) ✔ 36. plan() (1 test) (2ms) - plan() - workers= \ plan() - workers= (1/1) ★ 37. plan() - workers= (1 test) (1ms) ★ lazy=FALSE, globals=TRUE, stdout=TRUE Test skipped - plan() - workers= \ plan() - workers= (1/1) ★ 38. plan() - workers= (1 test) (1ms) ★ lazy=FALSE, globals=TRUE, stdout=TRUE Test skipped - plan() - workers= \ plan() - workers= (1/1) ★ 39. plan() - workers= (1 test) (1ms) ★ lazy=FALSE, globals=TRUE, stdout=TRUE Test skipped - resolve() \ resolve() (1/8) | resolve() (2/8) / resolve() (3/8) - resolve() (4/8) \ resolve() (5/8) | resolve() (6/8) / resolve() (7/8) - resolve() (8/8) ✔ 40. resolve() (8 tests) (4.1s) - resolve() - run-time exception \ resolve() - run-time exception (1/8) | resolve() - run-time exception (2/8) / resolve() - run-time exception (3/8) - resolve() - run-time exception (4/8) \ resolve() - run-time exception (5/8) | resolve() - run-time exception (6/8) / resolve() - run-time exception (7/8) - resolve() - run-time exception (8/8) ✔ 41. resolve() - run-time exception (8 tests) (66ms) - resolve() \ resolve() (1/2) | resolve() (2/2) ✔ 42. resolve() (2 tests) (18ms) - resolve() \ resolve() (1/2) | resolve() (2/2) ✔ 43. resolve() (2 tests) (27ms) - resolve() - time ordering \ resolve() - time ordering (1/1) ✔ 44. resolve() - time ordering (1 test) (522ms) - resolved() - assert non-blocking while launching lazy futures \ resolved() - assert non-blocking while launching lazy futures (1/1) ✔ 45. resolved() - assert non-blocking while launching lazy futures (1 test) (3.1s) - Random Number Generation (RNG) - seeds and preserving RNGkind \ Random Number Generation (RNG) - seeds and preserving RNGkind (1/1) ✔ 46. Random Number Generation (RNG) - seeds and preserving RNGkind (1 test) (12ms) - Random Number Generation (RNG) - future \ Random Number Generation (RNG) - future (1/2) | Random Number Generation (RNG) - future (2/2) ✔ 47. Random Number Generation (RNG) - future (2 tests) (152ms) - Random Number Generation (RNG) - %<-% \ Random Number Generation (RNG) - %<-% (1/2) | Random Number Generation (RNG) - %<-% (2/2) ✔ 48. Random Number Generation (RNG) - %<-% (2 tests) (146ms) - Orchestration Stability - future() does not update RNG state \ Orchestration Stability - future() does not update RNG state (1/1) ✔ 49. Orchestration Stability - future() does not update RNG state (1 test) (13ms) - Orchestration Stability - run() does not update RNG state \ Orchestration Stability - run() does not update RNG state (1/1) ✔ 50. Orchestration Stability - run() does not update RNG state (1 test) (11ms) - Orchestration Stability - result() does not update RNG state \ Orchestration Stability - result() does not update RNG state (1/1) ✔ 51. Orchestration Stability - result() does not update RNG state (1 test) (11ms) - Orchestration Stability - value() does not update RNG state \ Orchestration Stability - value() does not update RNG state (1/1) ✔ 52. Orchestration Stability - value() does not update RNG state (1 test) (11ms) - future() - standard output \ future() - standard output (1/2) | future() - standard output (2/2) ✔ 53. future() - standard output (2 tests) (83ms) - %<-% - standard output \ %<-% - standard output (1/2) | %<-% - standard output (2/2) ✔ 54. %<-% - standard output (2 tests) (43ms) - value() - visibility \ value() - visibility (1/1) ✔ 55. value() - visibility (1 test) (14ms) Number of tests: 55 Number of test steps: 100 Duration: 11.8s Results: 97 ok ✔ | 3 skips ★ | 0 errors ✖ | 0 timeouts T ERROR: Unknown command "TMPDIR=D:/temp/2025_03_31_07_20_17_27831/RtmpO0zawY/file1088448274f1a". Did you mean command "preview"? ─ Session info ─────────────────────────────────────────────────────────────── setting value version R version 4.5.0 beta (2025-03-29 r88074 ucrt) os Windows Server 2022 x64 (build 20348) system x86_64, mingw32 ui RTerm language C collate C ctype German_Germany.utf8 tz Europe/Berlin date 2025-03-31 pandoc 3.1 @ C:\\PROGRA~1\\Pandoc\\pandoc.exe quarto NA @ C:\\PROGRA~1\\Quarto\\bin\\quarto.exe ─ Packages ─────────────────────────────────────────────────────────────────── ! package * version date (UTC) lib source P bit * 4.6.0 2025-03-06 [?] CRAN (R 4.5.0) P cli 3.6.4 2025-02-13 [?] CRAN (R 4.5.0) P codetools 0.2-20 2024-03-31 [?] CRAN (R 4.5.0) P crayon 1.5.3 2024-06-20 [?] CRAN (R 4.5.0) P data.table * 1.17.0 2025-02-22 [?] CRAN (R 4.5.0) P digest 0.6.37 2024-08-19 [?] CRAN (R 4.5.0) P ff * 4.5.2 2025-01-13 [?] CRAN (R 4.5.0) P future * 1.34.0 2024-07-29 [?] CRAN (R 4.5.0) P future.tests 0.8.0 2025-03-31 [?] local P globals 0.16.3 2024-03-08 [?] CRAN (R 4.5.0) P listenv 0.9.1 2024-01-29 [?] CRAN (R 4.5.0) P parallelly 1.43.0 2025-03-24 [?] CRAN (R 4.5.0) P prettyunits 1.2.0 2023-09-24 [?] CRAN (R 4.5.0) P sessioninfo 1.2.3 2025-02-05 [?] CRAN (R 4.5.0) [1] D:/temp/2025_03_31_07_20_17_27831/RtmpOsNkI4/RLIBS_1f5b069e625b9 [2] D:/RCompile/recent/R/library * ── Packages attached to the search path. P ── Loaded and on-disk path mismatch. ────────────────────────────────────────────────────────────────────────────── [[1]] [[1]][[1]] [[1]][[1]][[1]] TestResult: - Test: - Title: 'future() - conditions' - Tags: 'future', 'conditions' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: captureConditions <- function (...) 3: { 4: conditions <- list() 5: withCallingHandlers(..., condition = function(c) { 6: conditions[[length(conditions) + 1L]] <<- c 7: if (inherits(c, "message")) { 8: invokeRestart("muffleMessage") 9: } 10: else if (inherits(c, "warning")) { 11: invokeRestart("muffleWarning") 12: } 13: }) 14: conditions 15: } 16: truth <- captureConditions({ 17: message("hello") 18: warning("whoops") 19: message("world") 20: }) 21: f <- future({ 22: print(1:3) 23: message("hello") 24: warning("whoops") 25: message("world") 26: 42L 27: }) 28: r <- result(f) 29: str(r) 30: stopifnot(value(f) == 42L) 31: conditions <- r$conditions 32: stopifnot(is.list(conditions), length(conditions) == 3L) 33: conditions <- lapply(conditions, FUN = function(c) c$condition) 34: for (kk in seq_along(conditions)) { 35: stopifnot(identical(class(conditions[[kk]]), class(truth[[kk]])), 36: identical(conditions[[kk]]$message, truth[[kk]]$message)) 37: } 38: conditions <- captureConditions(value(f)) 39: stopifnot(is.list(conditions), length(conditions) == 3L) 40: for (kk in seq_along(conditions)) { 41: stopifnot(identical(class(conditions[[kk]]), class(truth[[kk]])), 42: identical(conditions[[kk]]$message, truth[[kk]]$message)) 43: } 44: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: 'List of 11' 2: ' $ value : int 42' 3: ' $ visible : logi TRUE' 4: ' $ stdout : chr "[1] 1 2 3\n"' 5: ' $ conditions :List of 3' 6: ' ..$ :List of 2' 7: ' .. ..$ condition:List of 2' 8: ' .. .. ..$ message: chr "hello\n"' 9: ' .. .. ..$ call : language message("hello")' 10: ' .. .. ..- attr(*, "class")= chr [1:3] "simpleMessage" "message" "condition"' 11: ' .. ..$ signaled : int 0' 12: ' ..$ :List of 2' 13: ' .. ..$ condition:List of 2' 14: ' .. .. ..$ message: chr "whoops"' 15: ' .. .. ..$ call : language eval(quote({ print(1:3) ...' 16: ' .. .. ..- attr(*, "class")= chr [1:3] "simpleWarning" "warning" "condition"' 17: ' .. ..$ signaled : int 0' 18: ' ..$ :List of 2' 19: ' .. ..$ condition:List of 2' 20: ' .. .. ..$ message: chr "world\n"' 21: ' .. .. ..$ call : language message("world")' 22: ' .. .. ..- attr(*, "class")= chr [1:3] "simpleMessage" "message" "condition"' 23: ' .. ..$ signaled : int 0' 24: ' $ rng : logi FALSE' 25: ' $ globalenv : NULL' 26: ' $ started : POSIXct[1:1], format: "2025-03-31 07:22:13"' 27: ' $ finished : POSIXct[1:1], format: "2025-03-31 07:22:14"' 28: ' $ session_uuid: chr "06c6277d-6ec9-2e58-f4db-3d8c1a0b16a0"' 29: ' ..- attr(*, "source")=List of 5' 30: ' .. ..$ host : Named chr "CRANWIN3"' 31: ' .. .. ..- attr(*, "names")= chr "COMPUTERNAME"' 32: ' .. ..$ info : Named chr [1:9] "Windows" "Server x64" "build 20348" "CRANWIN3" ...' 33: ' .. .. ..- attr(*, "names")= chr [1:9] "sysname" "release" "version" "nodename" ...' 34: ' .. ..$ pid : int 67716' 35: ' .. ..$ time : POSIXct[1:1], format: "2025-03-31 07:22:11"' 36: ' .. ..$ random: int 2147483647' 37: ' $ r_info :List of 4' 38: ' ..$ version :Classes 'R_system_version', 'package_version', 'numeric_version' hidden list of 1' 39: ' .. ..$ : int [1:3] 4 5 0' 40: ' ..$ os : chr "windows"' 41: ' ..$ os_name : chr "Windows"' 42: ' ..$ captures_utf8: logi TRUE' 43: ' $ version : chr "1.8"' 44: ' - attr(*, "class")= chr "FutureResult"' 45: '[1] 1 2 3' 46: '[1] 1 2 3' - Success: TRUE - Processing time: 0.174 secs [[1]][[2]] [[1]][[2]][[1]] TestResult: - Test: - Title: '%<-% - conditions' - Tags: '%<-%', 'conditions' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: captureConditions <- function (...) 3: { 4: conditions <- list() 5: withCallingHandlers(..., condition = function(c) { 6: conditions[[length(conditions) + 1L]] <<- c 7: if (inherits(c, "message")) { 8: invokeRestart("muffleMessage") 9: } 10: else if (inherits(c, "warning")) { 11: invokeRestart("muffleWarning") 12: } 13: }) 14: conditions 15: } 16: truth <- captureConditions({ 17: message("hello") 18: warning("whoops") 19: message("world") 20: }) 21: v %<-% { 22: print(1:3) 23: message("hello") 24: warning("whoops") 25: message("world") 26: 42L 27: } 28: conditions <- captureConditions(v) 29: stopifnot(v == 42L) 30: stopifnot(is.list(conditions), length(conditions) == 3L) 31: for (kk in seq_along(conditions)) { 32: stopifnot(identical(class(conditions[[kk]]), class(truth[[kk]])), 33: identical(conditions[[kk]]$message, truth[[kk]]$message)) 34: } 35: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '[1] 1 2 3' - Success: TRUE - Processing time: 0.060 secs [[1]][[3]] [[1]][[3]][[1]] TestResult: - Test: - Title: 'future() - muffle conditions' - Tags: 'future', 'conditions', 'muffle' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: captureConditions <- function (...) 3: { 4: conditions <- list() 5: withCallingHandlers(..., condition = function(c) { 6: conditions[[length(conditions) + 1L]] <<- c 7: if (inherits(c, "message")) { 8: invokeRestart("muffleMessage") 9: } 10: else if (inherits(c, "warning")) { 11: invokeRestart("muffleWarning") 12: } 13: }) 14: conditions 15: } 16: f <- future({ 17: print(1:3) 18: message("hello") 19: warning("whoops") 20: message("world") 21: 42L 22: }, conditions = character(0L)) 23: r <- result(f) 24: str(r) 25: stopifnot(value(f) == 42L) 26: conditions <- r$conditions 27: stopifnot(is.list(conditions), length(conditions) == 0L) 28: conditions <- captureConditions(value(f)) 29: stopifnot(is.list(conditions), length(conditions) == 0L) 30: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: 'List of 11' 2: ' $ value : int 42' 3: ' $ visible : logi TRUE' 4: ' $ stdout : chr "[1] 1 2 3\n"' 5: ' $ conditions : list()' 6: ' $ rng : logi FALSE' 7: ' $ globalenv : NULL' 8: ' $ started : POSIXct[1:1], format: "2025-03-31 07:22:14"' 9: ' $ finished : POSIXct[1:1], format: "2025-03-31 07:22:14"' 10: ' $ session_uuid: chr "06c6277d-6ec9-2e58-f4db-3d8c1a0b16a0"' 11: ' ..- attr(*, "source")=List of 5' 12: ' .. ..$ host : Named chr "CRANWIN3"' 13: ' .. .. ..- attr(*, "names")= chr "COMPUTERNAME"' 14: ' .. ..$ info : Named chr [1:9] "Windows" "Server x64" "build 20348" "CRANWIN3" ...' 15: ' .. .. ..- attr(*, "names")= chr [1:9] "sysname" "release" "version" "nodename" ...' 16: ' .. ..$ pid : int 67716' 17: ' .. ..$ time : POSIXct[1:1], format: "2025-03-31 07:22:11"' 18: ' .. ..$ random: int 2147483647' 19: ' $ r_info :List of 4' 20: ' ..$ version :Classes 'R_system_version', 'package_version', 'numeric_version' hidden list of 1' 21: ' .. ..$ : int [1:3] 4 5 0' 22: ' ..$ os : chr "windows"' 23: ' ..$ os_name : chr "Windows"' 24: ' ..$ captures_utf8: logi TRUE' 25: ' $ version : chr "1.8"' 26: ' - attr(*, "class")= chr "FutureResult"' 27: '[1] 1 2 3' 28: '[1] 1 2 3' - Success: TRUE - Processing time: 0.078 secs [[1]][[4]] [[1]][[4]][[1]] TestResult: - Test: - Title: 'Argument '...'' - Tags: '%<-%', '...' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: fcn <- function(x, ...) { 3: message("Arguments '...' exists: ", exists("...", inherits = TRUE)) 4: y %<-% { 5: sum(x, ...) 6: } 7: y 8: } 9: y <- try(fcn(1:2, 3)) 10: print(y) 11: stopifnot(y == 6) 12: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '[1] 6' - Success: TRUE - Processing time: 0.012 secs [[1]][[5]] [[1]][[5]][[1]] TestResult: - Test: - Title: 'Argument '...' from parent function' - Tags: '%<-%', '...' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: fcn <- function(x, ...) { 3: sumt <- function(x) { 4: message("Arguments '...' exists: ", exists("...", 5: inherits = TRUE)) 6: y %<-% { 7: sum(x, ...) 8: } 9: y 10: } 11: sumt(x) 12: } 13: y <- try(fcn(1:2, 3)) 14: print(y) 15: stopifnot(y == 6) 16: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '[1] 6' - Success: TRUE - Processing time: 0.006 secs [[1]][[6]] [[1]][[6]][[1]] TestResult: - Test: - Title: 'Argument '...' - non existing' - Tags: '%<-%', '...' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: fcn <- function(x, y) { 3: message("Arguments '...' exists: ", exists("...", inherits = TRUE)) 4: y %<-% { 5: sum(x, y) 6: } 7: y 8: } 9: y <- try(fcn(1:2, 3)) 10: print(y) 11: stopifnot(y == 6) 12: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '[1] 6' - Success: TRUE - Processing time: 0.007 secs [[1]][[7]] [[1]][[7]][[1]] TestResult: - Test: - Title: 'Argument '...' - exception' - Tags: '%<-%', '...' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: fcn <- function(x, y) { 3: message("Arguments '...' exists: ", exists("...", inherits = TRUE)) 4: y %<-% { 5: sum(x, y, ...) 6: } 7: y 8: } 9: y <- try(fcn(1:2, 3)) 10: print(y) 11: stopifnot(inherits(y, "try-error")) 12: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: 'Error in eval(quote({ : '...' used in an incorrect context' 2: '[1] "Error in eval(quote({ : '...' used in an incorrect context\n"' 3: 'attr(,"class")' 4: '[1] "try-error"' 5: 'attr(,"condition")' 6: '' - Success: TRUE - Processing time: 0.011 secs [[1]][[8]] [[1]][[8]][[1]] TestResult: - Test: - Title: 'Early signaling of errors' - Tags: 'earlySignal', 'resolved', 'resolve' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. earlySignal: [n = 2] c(FALSE, TRUE) => Test combinations: 4 (= 2*2) - Expression: 1: { 2: res <- tryCatch({ 3: f <- future({ 4: stop("bang!") 5: }, lazy = lazy, earlySignal = earlySignal) 6: stopifnot(inherits(f, "Future")) 7: r <- resolved(f) 8: v <- tryCatch(value(f), error = identity) 9: stopifnot(inherits(v, "error"), conditionMessage(v) == 10: "bang!") 11: TRUE 12: }, error = identity) 13: stopifnot(inherits(res, "error") || isTRUE(res)) 14: } - Arguments tested: 1. lazy: FALSE 2. earlySignal: FALSE 3. globals: TRUE 4. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.009 secs [[1]][[8]][[2]] TestResult: - Test: - Title: 'Early signaling of errors' - Tags: 'earlySignal', 'resolved', 'resolve' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. earlySignal: [n = 2] c(FALSE, TRUE) => Test combinations: 4 (= 2*2) - Expression: 1: { 2: res <- tryCatch({ 3: f <- future({ 4: stop("bang!") 5: }, lazy = lazy, earlySignal = earlySignal) 6: stopifnot(inherits(f, "Future")) 7: r <- resolved(f) 8: v <- tryCatch(value(f), error = identity) 9: stopifnot(inherits(v, "error"), conditionMessage(v) == 10: "bang!") 11: TRUE 12: }, error = identity) 13: stopifnot(inherits(res, "error") || isTRUE(res)) 14: } - Arguments tested: 1. lazy: TRUE 2. earlySignal: FALSE 3. globals: TRUE 4. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.009 secs [[1]][[8]][[3]] TestResult: - Test: - Title: 'Early signaling of errors' - Tags: 'earlySignal', 'resolved', 'resolve' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. earlySignal: [n = 2] c(FALSE, TRUE) => Test combinations: 4 (= 2*2) - Expression: 1: { 2: res <- tryCatch({ 3: f <- future({ 4: stop("bang!") 5: }, lazy = lazy, earlySignal = earlySignal) 6: stopifnot(inherits(f, "Future")) 7: r <- resolved(f) 8: v <- tryCatch(value(f), error = identity) 9: stopifnot(inherits(v, "error"), conditionMessage(v) == 10: "bang!") 11: TRUE 12: }, error = identity) 13: stopifnot(inherits(res, "error") || isTRUE(res)) 14: } - Arguments tested: 1. lazy: FALSE 2. earlySignal: TRUE 3. globals: TRUE 4. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.008 secs [[1]][[8]][[4]] TestResult: - Test: - Title: 'Early signaling of errors' - Tags: 'earlySignal', 'resolved', 'resolve' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. earlySignal: [n = 2] c(FALSE, TRUE) => Test combinations: 4 (= 2*2) - Expression: 1: { 2: res <- tryCatch({ 3: f <- future({ 4: stop("bang!") 5: }, lazy = lazy, earlySignal = earlySignal) 6: stopifnot(inherits(f, "Future")) 7: r <- resolved(f) 8: v <- tryCatch(value(f), error = identity) 9: stopifnot(inherits(v, "error"), conditionMessage(v) == 10: "bang!") 11: TRUE 12: }, error = identity) 13: stopifnot(inherits(res, "error") || isTRUE(res)) 14: } - Arguments tested: 1. lazy: TRUE 2. earlySignal: TRUE 3. globals: TRUE 4. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.008 secs [[1]][[9]] [[1]][[9]][[1]] TestResult: - Test: - Title: 'Early signaling of warnings' - Tags: 'earlySignal', 'resolved', 'resolve' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. earlySignal: [n = 2] c(FALSE, TRUE) => Test combinations: 4 (= 2*2) - Expression: 1: { 2: res <- tryCatch({ 3: f <- future({ 4: warning("watch out!") 5: }, lazy = lazy, earlySignal = earlySignal) 6: stopifnot(inherits(f, "Future")) 7: r <- resolved(f) 8: v <- tryCatch(value(f), warning = identity) 9: stopifnot(inherits(v, "warning"), conditionMessage(v) == 10: "watch out!") 11: TRUE 12: }, error = identity) 13: stopifnot(inherits(res, "error") || isTRUE(res)) 14: } - Arguments tested: 1. lazy: FALSE 2. earlySignal: FALSE 3. globals: TRUE 4. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.008 secs [[1]][[9]][[2]] TestResult: - Test: - Title: 'Early signaling of warnings' - Tags: 'earlySignal', 'resolved', 'resolve' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. earlySignal: [n = 2] c(FALSE, TRUE) => Test combinations: 4 (= 2*2) - Expression: 1: { 2: res <- tryCatch({ 3: f <- future({ 4: warning("watch out!") 5: }, lazy = lazy, earlySignal = earlySignal) 6: stopifnot(inherits(f, "Future")) 7: r <- resolved(f) 8: v <- tryCatch(value(f), warning = identity) 9: stopifnot(inherits(v, "warning"), conditionMessage(v) == 10: "watch out!") 11: TRUE 12: }, error = identity) 13: stopifnot(inherits(res, "error") || isTRUE(res)) 14: } - Arguments tested: 1. lazy: TRUE 2. earlySignal: FALSE 3. globals: TRUE 4. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.007 secs [[1]][[9]][[3]] TestResult: - Test: - Title: 'Early signaling of warnings' - Tags: 'earlySignal', 'resolved', 'resolve' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. earlySignal: [n = 2] c(FALSE, TRUE) => Test combinations: 4 (= 2*2) - Expression: 1: { 2: res <- tryCatch({ 3: f <- future({ 4: warning("watch out!") 5: }, lazy = lazy, earlySignal = earlySignal) 6: stopifnot(inherits(f, "Future")) 7: r <- resolved(f) 8: v <- tryCatch(value(f), warning = identity) 9: stopifnot(inherits(v, "warning"), conditionMessage(v) == 10: "watch out!") 11: TRUE 12: }, error = identity) 13: stopifnot(inherits(res, "error") || isTRUE(res)) 14: } - Arguments tested: 1. lazy: FALSE 2. earlySignal: TRUE 3. globals: TRUE 4. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.005 secs [[1]][[9]][[4]] TestResult: - Test: - Title: 'Early signaling of warnings' - Tags: 'earlySignal', 'resolved', 'resolve' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. earlySignal: [n = 2] c(FALSE, TRUE) => Test combinations: 4 (= 2*2) - Expression: 1: { 2: res <- tryCatch({ 3: f <- future({ 4: warning("watch out!") 5: }, lazy = lazy, earlySignal = earlySignal) 6: stopifnot(inherits(f, "Future")) 7: r <- resolved(f) 8: v <- tryCatch(value(f), warning = identity) 9: stopifnot(inherits(v, "warning"), conditionMessage(v) == 10: "watch out!") 11: TRUE 12: }, error = identity) 13: stopifnot(inherits(res, "error") || isTRUE(res)) 14: } - Arguments tested: 1. lazy: TRUE 2. earlySignal: TRUE 3. globals: TRUE 4. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.005 secs [[1]][[10]] [[1]][[10]][[1]] TestResult: - Test: - Title: 'Early signaling of messages' - Tags: 'earlySignal', 'resolved', 'resolve' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. earlySignal: [n = 2] c(FALSE, TRUE) => Test combinations: 4 (= 2*2) - Expression: 1: { 2: res <- tryCatch({ 3: f <- future({ 4: message("hello world!") 5: }, lazy = lazy, earlySignal = earlySignal) 6: stopifnot(inherits(f, "Future")) 7: r <- resolved(f) 8: v <- tryCatch(value(f), message = identity) 9: stopifnot(inherits(v, "message"), conditionMessage(v) == 10: "hello world!") 11: TRUE 12: }, error = identity) 13: stopifnot(inherits(res, "error") || isTRUE(res)) 14: } - Arguments tested: 1. lazy: FALSE 2. earlySignal: FALSE 3. globals: TRUE 4. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.005 secs [[1]][[10]][[2]] TestResult: - Test: - Title: 'Early signaling of messages' - Tags: 'earlySignal', 'resolved', 'resolve' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. earlySignal: [n = 2] c(FALSE, TRUE) => Test combinations: 4 (= 2*2) - Expression: 1: { 2: res <- tryCatch({ 3: f <- future({ 4: message("hello world!") 5: }, lazy = lazy, earlySignal = earlySignal) 6: stopifnot(inherits(f, "Future")) 7: r <- resolved(f) 8: v <- tryCatch(value(f), message = identity) 9: stopifnot(inherits(v, "message"), conditionMessage(v) == 10: "hello world!") 11: TRUE 12: }, error = identity) 13: stopifnot(inherits(res, "error") || isTRUE(res)) 14: } - Arguments tested: 1. lazy: TRUE 2. earlySignal: FALSE 3. globals: TRUE 4. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.009 secs [[1]][[10]][[3]] TestResult: - Test: - Title: 'Early signaling of messages' - Tags: 'earlySignal', 'resolved', 'resolve' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. earlySignal: [n = 2] c(FALSE, TRUE) => Test combinations: 4 (= 2*2) - Expression: 1: { 2: res <- tryCatch({ 3: f <- future({ 4: message("hello world!") 5: }, lazy = lazy, earlySignal = earlySignal) 6: stopifnot(inherits(f, "Future")) 7: r <- resolved(f) 8: v <- tryCatch(value(f), message = identity) 9: stopifnot(inherits(v, "message"), conditionMessage(v) == 10: "hello world!") 11: TRUE 12: }, error = identity) 13: stopifnot(inherits(res, "error") || isTRUE(res)) 14: } - Arguments tested: 1. lazy: FALSE 2. earlySignal: TRUE 3. globals: TRUE 4. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.009 secs [[1]][[10]][[4]] TestResult: - Test: - Title: 'Early signaling of messages' - Tags: 'earlySignal', 'resolved', 'resolve' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. earlySignal: [n = 2] c(FALSE, TRUE) => Test combinations: 4 (= 2*2) - Expression: 1: { 2: res <- tryCatch({ 3: f <- future({ 4: message("hello world!") 5: }, lazy = lazy, earlySignal = earlySignal) 6: stopifnot(inherits(f, "Future")) 7: r <- resolved(f) 8: v <- tryCatch(value(f), message = identity) 9: stopifnot(inherits(v, "message"), conditionMessage(v) == 10: "hello world!") 11: TRUE 12: }, error = identity) 13: stopifnot(inherits(res, "error") || isTRUE(res)) 14: } - Arguments tested: 1. lazy: TRUE 2. earlySignal: TRUE 3. globals: TRUE 4. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.009 secs [[1]][[11]] [[1]][[11]][[1]] TestResult: - Test: - Title: 'futureAssign() - lazy evaluation' - Tags: 'futureAssign', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: delayedAssign("a", { 3: cat("Delayed assignment evaluated\n") 4: 1 5: }) 6: futureAssign("b", { 7: cat("Future assignment evaluated\n") 8: 2 9: }, lazy = lazy) 10: cat(sprintf("b = %s\n", b)) 11: cat(sprintf("a = %s\n", a)) 12: stopifnot(identical(a, 1)) 13: stopifnot(identical(b, 2)) 14: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: 'Future assignment evaluated' 2: 'b = 2' 3: 'Delayed assignment evaluated' 4: 'a = 1' - Success: TRUE - Processing time: 0.005 secs [[1]][[11]][[2]] TestResult: - Test: - Title: 'futureAssign() - lazy evaluation' - Tags: 'futureAssign', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: delayedAssign("a", { 3: cat("Delayed assignment evaluated\n") 4: 1 5: }) 6: futureAssign("b", { 7: cat("Future assignment evaluated\n") 8: 2 9: }, lazy = lazy) 10: cat(sprintf("b = %s\n", b)) 11: cat(sprintf("a = %s\n", a)) 12: stopifnot(identical(a, 1)) 13: stopifnot(identical(b, 2)) 14: } - Arguments tested: 1. lazy: TRUE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: 'Future assignment evaluated' 2: 'b = 2' 3: 'Delayed assignment evaluated' 4: 'a = 1' - Success: TRUE - Processing time: 0.009 secs [[1]][[12]] [[1]][[12]][[1]] TestResult: - Test: - Title: 'futureAssign() - potential task name clashes' - Tags: 'futureAssign' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: u <- new.env() 3: v <- new.env() 4: futureAssign("a", { 5: 2 6: }, assign.env = u) 7: futureAssign("a", { 8: 4 9: }, assign.env = v) 10: cat(sprintf("u$a = %s\n", u$a)) 11: cat(sprintf("v$a = %s\n", v$a)) 12: stopifnot(identical(u$a, 2)) 13: stopifnot(identical(v$a, 4)) 14: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: 'u$a = 2' 2: 'v$a = 4' - Success: TRUE - Processing time: 0.015 secs [[1]][[13]] [[1]][[13]][[1]] TestResult: - Test: - Title: 'futureAssign() - global variables with and without lazy evaluation' - Tags: 'futureAssign', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: a <- 1 3: futureAssign("b", { 4: 2 * a 5: }) 6: a <- 2 7: stopifnot(b == 2) 8: a <- 1 9: f <- futureAssign("b", { 10: 2 + a 11: }, lazy = lazy) 12: a <- 2 13: stopifnot(b == 3) 14: print(f) 15: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: 'SequentialFuture:' 2: 'Label: ''' 3: 'Expression:' 4: '{' 5: ' 2 + a' 6: '}' 7: 'Lazy evaluation: FALSE' 8: 'Asynchronous evaluation: FALSE' 9: 'Local evaluation: TRUE' 10: 'Environment: 0x000002954aa62820' 11: 'Capture standard output: TRUE' 12: 'Capture condition classes: 'condition' (excluding 'nothing')' 13: 'Globals: 1 objects totaling 39 bytes (numeric 'a' of 39 bytes)' 14: 'Packages: ' 15: 'L'Ecuyer-CMRG RNG seed: (seed = FALSE)' 16: 'Resolved: TRUE' 17: 'Value: 39 bytes of class 'numeric'' 18: 'Early signaling: FALSE' 19: 'Owner process: 06c6277d-6ec9-2e58-f4db-3d8c1a0b16a0' 20: 'Class: 'SequentialFuture', 'UniprocessFuture', 'Future', 'environment'' - Success: TRUE - Processing time: 0.020 secs [[1]][[13]][[2]] TestResult: - Test: - Title: 'futureAssign() - global variables with and without lazy evaluation' - Tags: 'futureAssign', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: a <- 1 3: futureAssign("b", { 4: 2 * a 5: }) 6: a <- 2 7: stopifnot(b == 2) 8: a <- 1 9: f <- futureAssign("b", { 10: 2 + a 11: }, lazy = lazy) 12: a <- 2 13: stopifnot(b == 3) 14: print(f) 15: } - Arguments tested: 1. lazy: TRUE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: 'SequentialFuture:' 2: 'Label: ''' 3: 'Expression:' 4: '{' 5: ' 2 + a' 6: '}' 7: 'Lazy evaluation: TRUE' 8: 'Asynchronous evaluation: FALSE' 9: 'Local evaluation: TRUE' 10: 'Environment: 0x000002954b2aeb38' 11: 'Capture standard output: TRUE' 12: 'Capture condition classes: 'condition' (excluding 'nothing')' 13: 'Globals: 1 objects totaling 39 bytes (numeric 'a' of 39 bytes)' 14: 'Packages: ' 15: 'L'Ecuyer-CMRG RNG seed: (seed = FALSE)' 16: 'Resolved: TRUE' 17: 'Value: 39 bytes of class 'numeric'' 18: 'Early signaling: FALSE' 19: 'Owner process: 06c6277d-6ec9-2e58-f4db-3d8c1a0b16a0' 20: 'Class: 'SequentialFuture', 'UniprocessFuture', 'Future', 'environment'' - Success: TRUE - Processing time: 0.018 secs [[1]][[14]] [[1]][[14]][[1]] TestResult: - Test: - Title: 'futureAssign() - lazy evaluation via disposable option' - Tags: 'futureAssign', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: options(future.disposable = list(lazy = lazy)) 3: on.exit(options(future.disposable = NULL)) 4: a <- 1 5: f <- futureAssign("b", { 6: 4/a 7: }) 8: a <- 2 9: stopifnot(b == 4) 10: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.009 secs [[1]][[14]][[2]] TestResult: - Test: - Title: 'futureAssign() - lazy evaluation via disposable option' - Tags: 'futureAssign', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: options(future.disposable = list(lazy = lazy)) 3: on.exit(options(future.disposable = NULL)) 4: a <- 1 5: f <- futureAssign("b", { 6: 4/a 7: }) 8: a <- 2 9: stopifnot(b == 4) 10: } - Arguments tested: 1. lazy: TRUE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.009 secs [[1]][[15]] [[1]][[15]][[1]] TestResult: - Test: - Title: '%<-% - local evaluation' - Tags: '%<-%', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: v %<-% { 3: x <- 1 4: } %lazy% lazy 5: stopifnot(!exists("x", inherits = FALSE), identical(v, 1)) 6: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.008 secs [[1]][[15]][[2]] TestResult: - Test: - Title: '%<-% - local evaluation' - Tags: '%<-%', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: v %<-% { 3: x <- 1 4: } %lazy% lazy 5: stopifnot(!exists("x", inherits = FALSE), identical(v, 1)) 6: } - Arguments tested: 1. lazy: TRUE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.008 secs [[1]][[16]] [[1]][[16]][[1]] TestResult: - Test: - Title: '%<-% - local evaluation & global variable' - Tags: '%<-%', 'lazy', 'global' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: a <- 2 3: v %<-% { 4: x <- a 5: } %lazy% lazy 6: stopifnot(!exists("x", inherits = FALSE), identical(v, a)) 7: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.008 secs [[1]][[16]][[2]] TestResult: - Test: - Title: '%<-% - local evaluation & global variable' - Tags: '%<-%', 'lazy', 'global' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: a <- 2 3: v %<-% { 4: x <- a 5: } %lazy% lazy 6: stopifnot(!exists("x", inherits = FALSE), identical(v, a)) 7: } - Arguments tested: 1. lazy: TRUE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.008 secs [[1]][[17]] [[1]][[17]][[1]] TestResult: - Test: - Title: '%<-% - errors' - Tags: '%<-%', 'lazy', 'error' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: v %<-% { 3: x <- 3 4: stop("Woops!") 5: x 6: } %lazy% lazy 7: stopifnot(!exists("x", inherits = FALSE)) 8: res <- tryCatch(identical(v, 3), error = identity) 9: stopifnot(inherits(res, "error")) 10: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.009 secs [[1]][[17]][[2]] TestResult: - Test: - Title: '%<-% - errors' - Tags: '%<-%', 'lazy', 'error' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: v %<-% { 3: x <- 3 4: stop("Woops!") 5: x 6: } %lazy% lazy 7: stopifnot(!exists("x", inherits = FALSE)) 8: res <- tryCatch(identical(v, 3), error = identity) 9: stopifnot(inherits(res, "error")) 10: } - Arguments tested: 1. lazy: TRUE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.009 secs [[1]][[18]] [[1]][[18]][[1]] TestResult: - Test: - Title: '%<-% - errors and listenv' - Tags: '%<-%', 'lazy', 'error', 'listenv' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: y <- listenv::listenv() 3: for (ii in 1:3) { 4: y[[ii]] %<-% { 5: if (ii%%2 == 0) 6: stop("Woops!") 7: ii 8: } 9: } %lazy% lazy 10: res <- tryCatch(as.list(y), error = identity) 11: stopifnot(inherits(res, "error")) 12: z <- y[c(1, 3)] 13: z <- unlist(z) 14: stopifnot(all(z == c(1, 3))) 15: res <- tryCatch(y[[2]], error = identity) 16: stopifnot(inherits(res, "error")) 17: res <- tryCatch(y[1:2], error = identity) 18: stopifnot(inherits(res, "error")) 19: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.035 secs [[1]][[18]][[2]] TestResult: - Test: - Title: '%<-% - errors and listenv' - Tags: '%<-%', 'lazy', 'error', 'listenv' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: y <- listenv::listenv() 3: for (ii in 1:3) { 4: y[[ii]] %<-% { 5: if (ii%%2 == 0) 6: stop("Woops!") 7: ii 8: } 9: } %lazy% lazy 10: res <- tryCatch(as.list(y), error = identity) 11: stopifnot(inherits(res, "error")) 12: z <- y[c(1, 3)] 13: z <- unlist(z) 14: stopifnot(all(z == c(1, 3))) 15: res <- tryCatch(y[[2]], error = identity) 16: stopifnot(inherits(res, "error")) 17: res <- tryCatch(y[1:2], error = identity) 18: stopifnot(inherits(res, "error")) 19: } - Arguments tested: 1. lazy: TRUE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.034 secs [[1]][[19]] [[1]][[19]][[1]] TestResult: - Test: - Title: '%<-% & %->%' - Tags: '%<-%', '%->%', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: c %<-% 1 %lazy% lazy 3: cat(sprintf("c = %s\n", c)) 4: 1 %->% d %lazy% lazy 5: cat(sprintf("d = %s\n", d)) 6: stopifnot(d == c) 7: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: 'c = 1' 2: 'd = 1' - Success: TRUE - Processing time: 0.010 secs [[1]][[19]][[2]] TestResult: - Test: - Title: '%<-% & %->%' - Tags: '%<-%', '%->%', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: c %<-% 1 %lazy% lazy 3: cat(sprintf("c = %s\n", c)) 4: 1 %->% d %lazy% lazy 5: cat(sprintf("d = %s\n", d)) 6: stopifnot(d == c) 7: } - Arguments tested: 1. lazy: TRUE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: 'c = 1' 2: 'd = 1' - Success: TRUE - Processing time: 0.009 secs [[1]][[20]] [[1]][[20]][[1]] TestResult: - Test: - Title: '%<-% - nested' - Tags: '%<-%', 'nested' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: a %<-% { 3: b <- 1 4: c %<-% 2 5: d <- 3 6: 4 %->% e 7: b + c + d + e 8: } 9: cat(sprintf("a = %s\n", a)) 10: stopifnot(a == 10) 11: { 12: a + 1 13: } %->% b 14: cat(sprintf("b = %s\n", b)) 15: stopifnot(b == a + 1) 16: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: 'a = 10' 2: 'b = 11' - Success: TRUE - Processing time: 0.027 secs [[1]][[21]] [[1]][[21]][[1]] TestResult: - Test: - Title: 'futureCall()' - Tags: 'futureCall', 'lazy', 'globals', 'globals-automatic' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. globals: [n = 2] c(FALSE, TRUE) => Test combinations: 4 (= 2*2) - Expression: 1: { 2: if (!isTRUE(getOption("future.tests.suppress_messages", TRUE))) { 3: options(future.debug = TRUE) 4: } 5: a <- 3 6: args <- list(x = 42, y = 12) 7: v0 <- do.call(function(x, y) a * (x - y), args = args) 8: f <- futureCall(function(x, y) a * (x - y), args = args, 9: globals = globals, lazy = lazy) 10: rm(list = c("a", "args")) 11: print(f) 12: str(f$globals) 13: cat("- FUN(): --------------------\n") 14: FUN <- f$globals$FUN 15: print(utils::ls.str(environment(FUN))) 16: cat("-----------------------------\n") 17: res <- tryCatch({ 18: v <- value(f) 19: }, error = identity) 20: stopifnot(!inherits(res, "FutureError")) 21: if (!inherits(res, "error")) { 22: str(list(globals = globals, lazy = lazy, v0 = v0, v = v)) 23: stopifnot(all.equal(v, v0)) 24: } 25: else { 26: str(list(globals = globals, lazy = lazy, v0 = v0, res = res)) 27: stopifnot(!globals) 28: } 29: } - Arguments tested: 1. lazy: FALSE 2. globals: FALSE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: 'SequentialFuture:' 2: 'Label: ''' 3: 'Expression:' 4: 'do.call(what = FUN, args = args)' 5: 'Lazy evaluation: FALSE' 6: 'Asynchronous evaluation: FALSE' 7: 'Local evaluation: TRUE' 8: 'Environment: 0x000002954bdb8ed8' 9: 'Capture standard output: TRUE' 10: 'Capture condition classes: 'condition' (excluding 'nothing')' 11: 'Globals: 2 objects totaling 64.49 KiB (function 'FUN' of 64.38 KiB, list 'args' of 114 bytes)' 12: 'Packages: ' 13: 'L'Ecuyer-CMRG RNG seed: (seed = FALSE)' 14: 'Resolved: TRUE' 15: 'Value: 27 bytes of class 'NULL'' 16: 'Conditions captured: [n=1] 'simpleError'' 17: 'Early signaling: FALSE' 18: 'Owner process: 06c6277d-6ec9-2e58-f4db-3d8c1a0b16a0' 19: 'Class: 'SequentialFuture', 'UniprocessFuture', 'Future', 'environment'' 20: 'List of 2' 21: ' $ FUN :function (x, y) ' 22: ' $ args:List of 2' 23: ' ..$ x: num 42' 24: ' ..$ y: num 12' 25: ' - attr(*, "where")=List of 2' 26: ' ..$ FUN : ' 27: ' ..$ args: ' 28: ' - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"' 29: ' - attr(*, "resolved")= logi FALSE' 30: ' - attr(*, "total_size")= num 705' 31: ' - attr(*, "already-done")= logi TRUE' 32: '- FUN(): --------------------' 33: 'FUN : function (x, y) ' 34: 'f : Classes 'SequentialFuture', 'UniprocessFuture', 'Future', 'environment' ' 35: 'globals : logi FALSE' 36: 'lazy : logi FALSE' 37: 'stdout : logi TRUE' 38: 'v0 : num 90' 39: '-----------------------------' 40: 'List of 4' 41: ' $ globals: logi FALSE' 42: ' $ lazy : logi FALSE' 43: ' $ v0 : num 90' 44: ' $ res :List of 2' 45: ' ..$ message: chr "object 'a' not found"' 46: ' ..$ call : language (function (x, y) a * (x - y))(x = 42, y = 12)' 47: ' ..- attr(*, "class")= chr [1:3] "simpleError" "error" "condition"' - Success: TRUE - Processing time: 0.023 secs [[1]][[21]][[2]] TestResult: - Test: - Title: 'futureCall()' - Tags: 'futureCall', 'lazy', 'globals', 'globals-automatic' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. globals: [n = 2] c(FALSE, TRUE) => Test combinations: 4 (= 2*2) - Expression: 1: { 2: if (!isTRUE(getOption("future.tests.suppress_messages", TRUE))) { 3: options(future.debug = TRUE) 4: } 5: a <- 3 6: args <- list(x = 42, y = 12) 7: v0 <- do.call(function(x, y) a * (x - y), args = args) 8: f <- futureCall(function(x, y) a * (x - y), args = args, 9: globals = globals, lazy = lazy) 10: rm(list = c("a", "args")) 11: print(f) 12: str(f$globals) 13: cat("- FUN(): --------------------\n") 14: FUN <- f$globals$FUN 15: print(utils::ls.str(environment(FUN))) 16: cat("-----------------------------\n") 17: res <- tryCatch({ 18: v <- value(f) 19: }, error = identity) 20: stopifnot(!inherits(res, "FutureError")) 21: if (!inherits(res, "error")) { 22: str(list(globals = globals, lazy = lazy, v0 = v0, v = v)) 23: stopifnot(all.equal(v, v0)) 24: } 25: else { 26: str(list(globals = globals, lazy = lazy, v0 = v0, res = res)) 27: stopifnot(!globals) 28: } 29: } - Arguments tested: 1. lazy: TRUE 2. globals: FALSE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: 'Future:' 2: 'Label: ''' 3: 'Expression:' 4: 'do.call(what = FUN, args = args)' 5: 'Lazy evaluation: TRUE' 6: 'Asynchronous evaluation: TRUE' 7: 'Local evaluation: TRUE' 8: 'Environment: 0x00000295493683e0' 9: 'Capture standard output: TRUE' 10: 'Capture condition classes: 'condition' (excluding 'nothing')' 11: 'Globals: 2 objects totaling 7.90 KiB (function 'FUN' of 7.78 KiB, list 'args' of 114 bytes)' 12: 'Packages: ' 13: 'L'Ecuyer-CMRG RNG seed: (seed = FALSE)' 14: 'Resolved: FALSE' 15: 'Value: ' 16: 'Conditions captured: ' 17: 'Early signaling: FALSE' 18: 'Owner process: 06c6277d-6ec9-2e58-f4db-3d8c1a0b16a0' 19: 'Class: 'Future', 'environment'' 20: 'List of 2' 21: ' $ FUN :function (x, y) ' 22: ' $ args:List of 2' 23: ' ..$ x: num 42' 24: ' ..$ y: num 12' 25: ' - attr(*, "where")=List of 2' 26: ' ..$ FUN : ' 27: ' ..$ args: ' 28: ' - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"' 29: ' - attr(*, "resolved")= logi FALSE' 30: ' - attr(*, "total_size")= num 705' 31: ' - attr(*, "already-done")= logi TRUE' 32: '- FUN(): --------------------' 33: 'FUN : function (x, y) ' 34: 'f : Classes 'Future', 'environment' ' 35: 'globals : logi FALSE' 36: 'lazy : logi TRUE' 37: 'stdout : logi TRUE' 38: 'v0 : num 90' 39: '-----------------------------' 40: 'List of 4' 41: ' $ globals: logi FALSE' 42: ' $ lazy : logi TRUE' 43: ' $ v0 : num 90' 44: ' $ res :List of 2' 45: ' ..$ message: chr "object 'a' not found"' 46: ' ..$ call : language (function (x, y) a * (x - y))(x = 42, y = 12)' 47: ' ..- attr(*, "class")= chr [1:3] "simpleError" "error" "condition"' - Success: TRUE - Processing time: 0.023 secs [[1]][[21]][[3]] TestResult: - Test: - Title: 'futureCall()' - Tags: 'futureCall', 'lazy', 'globals', 'globals-automatic' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. globals: [n = 2] c(FALSE, TRUE) => Test combinations: 4 (= 2*2) - Expression: 1: { 2: if (!isTRUE(getOption("future.tests.suppress_messages", TRUE))) { 3: options(future.debug = TRUE) 4: } 5: a <- 3 6: args <- list(x = 42, y = 12) 7: v0 <- do.call(function(x, y) a * (x - y), args = args) 8: f <- futureCall(function(x, y) a * (x - y), args = args, 9: globals = globals, lazy = lazy) 10: rm(list = c("a", "args")) 11: print(f) 12: str(f$globals) 13: cat("- FUN(): --------------------\n") 14: FUN <- f$globals$FUN 15: print(utils::ls.str(environment(FUN))) 16: cat("-----------------------------\n") 17: res <- tryCatch({ 18: v <- value(f) 19: }, error = identity) 20: stopifnot(!inherits(res, "FutureError")) 21: if (!inherits(res, "error")) { 22: str(list(globals = globals, lazy = lazy, v0 = v0, v = v)) 23: stopifnot(all.equal(v, v0)) 24: } 25: else { 26: str(list(globals = globals, lazy = lazy, v0 = v0, res = res)) 27: stopifnot(!globals) 28: } 29: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: 'SequentialFuture:' 2: 'Label: ''' 3: 'Expression:' 4: 'do.call(what = FUN, args = args)' 5: 'Lazy evaluation: FALSE' 6: 'Asynchronous evaluation: FALSE' 7: 'Local evaluation: TRUE' 8: 'Environment: 0x0000029549f3f300' 9: 'Capture standard output: TRUE' 10: 'Capture condition classes: 'condition' (excluding 'nothing')' 11: 'Globals: 3 objects totaling 9.58 KiB (function 'FUN' of 9.43 KiB, list 'args' of 114 bytes, numeric 'a' of 39 bytes)' 12: 'Packages: ' 13: 'L'Ecuyer-CMRG RNG seed: (seed = FALSE)' 14: 'Resolved: TRUE' 15: 'Value: 39 bytes of class 'numeric'' 16: 'Early signaling: FALSE' 17: 'Owner process: 06c6277d-6ec9-2e58-f4db-3d8c1a0b16a0' 18: 'Class: 'SequentialFuture', 'UniprocessFuture', 'Future', 'environment'' 19: 'List of 3' 20: ' $ FUN :function (x, y) ' 21: ' $ args:List of 2' 22: ' ..$ x: num 42' 23: ' ..$ y: num 12' 24: ' $ a : num 3' 25: ' - attr(*, "where")=List of 3' 26: ' ..$ FUN : ' 27: ' ..$ args: ' 28: ' ..$ a : ' 29: ' - attr(*, "resolved")= logi FALSE' 30: ' - attr(*, "total_size")= num 744' 31: ' - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"' 32: ' - attr(*, "already-done")= logi TRUE' 33: '- FUN(): --------------------' 34: 'a : num 3' 35: '-----------------------------' 36: 'List of 4' 37: ' $ globals: logi TRUE' 38: ' $ lazy : logi FALSE' 39: ' $ v0 : num 90' 40: ' $ v : num 90' - Success: TRUE - Processing time: 0.026 secs [[1]][[21]][[4]] TestResult: - Test: - Title: 'futureCall()' - Tags: 'futureCall', 'lazy', 'globals', 'globals-automatic' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. globals: [n = 2] c(FALSE, TRUE) => Test combinations: 4 (= 2*2) - Expression: 1: { 2: if (!isTRUE(getOption("future.tests.suppress_messages", TRUE))) { 3: options(future.debug = TRUE) 4: } 5: a <- 3 6: args <- list(x = 42, y = 12) 7: v0 <- do.call(function(x, y) a * (x - y), args = args) 8: f <- futureCall(function(x, y) a * (x - y), args = args, 9: globals = globals, lazy = lazy) 10: rm(list = c("a", "args")) 11: print(f) 12: str(f$globals) 13: cat("- FUN(): --------------------\n") 14: FUN <- f$globals$FUN 15: print(utils::ls.str(environment(FUN))) 16: cat("-----------------------------\n") 17: res <- tryCatch({ 18: v <- value(f) 19: }, error = identity) 20: stopifnot(!inherits(res, "FutureError")) 21: if (!inherits(res, "error")) { 22: str(list(globals = globals, lazy = lazy, v0 = v0, v = v)) 23: stopifnot(all.equal(v, v0)) 24: } 25: else { 26: str(list(globals = globals, lazy = lazy, v0 = v0, res = res)) 27: stopifnot(!globals) 28: } 29: } - Arguments tested: 1. lazy: TRUE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: 'Future:' 2: 'Label: ''' 3: 'Expression:' 4: 'do.call(what = FUN, args = args)' 5: 'Lazy evaluation: TRUE' 6: 'Asynchronous evaluation: TRUE' 7: 'Local evaluation: TRUE' 8: 'Environment: 0x000002954ab38ac8' 9: 'Capture standard output: TRUE' 10: 'Capture condition classes: 'condition' (excluding 'nothing')' 11: 'Globals: 3 objects totaling 8.25 KiB (function 'FUN' of 8.10 KiB, list 'args' of 114 bytes, numeric 'a' of 39 bytes)' 12: 'Packages: ' 13: 'L'Ecuyer-CMRG RNG seed: (seed = FALSE)' 14: 'Resolved: FALSE' 15: 'Value: ' 16: 'Conditions captured: ' 17: 'Early signaling: FALSE' 18: 'Owner process: 06c6277d-6ec9-2e58-f4db-3d8c1a0b16a0' 19: 'Class: 'Future', 'environment'' 20: 'List of 3' 21: ' $ FUN :function (x, y) ' 22: ' $ args:List of 2' 23: ' ..$ x: num 42' 24: ' ..$ y: num 12' 25: ' $ a : num 3' 26: ' - attr(*, "where")=List of 3' 27: ' ..$ FUN : ' 28: ' ..$ args: ' 29: ' ..$ a : ' 30: ' - attr(*, "resolved")= logi FALSE' 31: ' - attr(*, "total_size")= num 744' 32: ' - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"' 33: ' - attr(*, "already-done")= logi TRUE' 34: '- FUN(): --------------------' 35: 'a : num 3' 36: '-----------------------------' 37: 'List of 4' 38: ' $ globals: logi TRUE' 39: ' $ lazy : logi TRUE' 40: ' $ v0 : num 90' 41: ' $ v : num 90' - Success: TRUE - Processing time: 0.025 secs [[1]][[22]] [[1]][[22]][[1]] TestResult: - Test: - Title: 'futureCall() - globals = list(a = 3)' - Tags: 'futureCall', 'lazy', 'globals', 'globals-by-value' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: a <- 3 3: args <- list(x = 42, y = 12) 4: v0 <- do.call(function(x, y) a * (x - y), args = args) 5: f <- futureCall(function(x, y) a * (x - y), args = args, 6: globals = list(a = 3), lazy = lazy) 7: rm(list = "args") 8: print(f) 9: res <- tryCatch({ 10: v <- value(f) 11: }, error = identity) 12: stopifnot(!inherits(res, "FutureError")) 13: if (!inherits(res, "error")) { 14: str(list(globals = globals, lazy = lazy, v0 = v0, v = v)) 15: stopifnot(all.equal(v, v0)) 16: } 17: else { 18: stopifnot(!globals) 19: } 20: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: 'SequentialFuture:' 2: 'Label: ''' 3: 'Expression:' 4: 'do.call(what = FUN, args = args)' 5: 'Lazy evaluation: FALSE' 6: 'Asynchronous evaluation: FALSE' 7: 'Local evaluation: TRUE' 8: 'Environment: 0x000002954b6ad5d8' 9: 'Capture standard output: TRUE' 10: 'Capture condition classes: 'condition' (excluding 'nothing')' 11: 'Globals: 3 objects totaling 9.61 KiB (numeric 'a' of 39 bytes, function 'FUN' of 9.46 KiB, list 'args' of 114 bytes)' 12: 'Packages: ' 13: 'L'Ecuyer-CMRG RNG seed: (seed = FALSE)' 14: 'Resolved: TRUE' 15: 'Value: 39 bytes of class 'numeric'' 16: 'Early signaling: FALSE' 17: 'Owner process: 06c6277d-6ec9-2e58-f4db-3d8c1a0b16a0' 18: 'Class: 'SequentialFuture', 'UniprocessFuture', 'Future', 'environment'' 19: 'List of 4' 20: ' $ globals: logi TRUE' 21: ' $ lazy : logi FALSE' 22: ' $ v0 : num 90' 23: ' $ v : num 90' - Success: TRUE - Processing time: 0.012 secs [[1]][[22]][[2]] TestResult: - Test: - Title: 'futureCall() - globals = list(a = 3)' - Tags: 'futureCall', 'lazy', 'globals', 'globals-by-value' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: a <- 3 3: args <- list(x = 42, y = 12) 4: v0 <- do.call(function(x, y) a * (x - y), args = args) 5: f <- futureCall(function(x, y) a * (x - y), args = args, 6: globals = list(a = 3), lazy = lazy) 7: rm(list = "args") 8: print(f) 9: res <- tryCatch({ 10: v <- value(f) 11: }, error = identity) 12: stopifnot(!inherits(res, "FutureError")) 13: if (!inherits(res, "error")) { 14: str(list(globals = globals, lazy = lazy, v0 = v0, v = v)) 15: stopifnot(all.equal(v, v0)) 16: } 17: else { 18: stopifnot(!globals) 19: } 20: } - Arguments tested: 1. lazy: TRUE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: 'Future:' 2: 'Label: ''' 3: 'Expression:' 4: 'do.call(what = FUN, args = args)' 5: 'Lazy evaluation: TRUE' 6: 'Asynchronous evaluation: TRUE' 7: 'Local evaluation: TRUE' 8: 'Environment: 0x000002954be2b878' 9: 'Capture standard output: TRUE' 10: 'Capture condition classes: 'condition' (excluding 'nothing')' 11: 'Globals: 3 objects totaling 8.28 KiB (numeric 'a' of 39 bytes, function 'FUN' of 8.13 KiB, list 'args' of 114 bytes)' 12: 'Packages: ' 13: 'L'Ecuyer-CMRG RNG seed: (seed = FALSE)' 14: 'Resolved: FALSE' 15: 'Value: ' 16: 'Conditions captured: ' 17: 'Early signaling: FALSE' 18: 'Owner process: 06c6277d-6ec9-2e58-f4db-3d8c1a0b16a0' 19: 'Class: 'Future', 'environment'' 20: 'List of 4' 21: ' $ globals: logi TRUE' 22: ' $ lazy : logi TRUE' 23: ' $ v0 : num 90' 24: ' $ v : num 90' - Success: TRUE - Processing time: 0.012 secs [[1]][[23]] [[1]][[23]][[1]] TestResult: - Test: - Title: 'futureCall() - globals = "a"' - Tags: 'futureCall', 'lazy', 'globals', 'globals-by-name' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: a <- 3 3: args <- list(x = 42, y = 12) 4: v0 <- do.call(function(x, y) a * (x - y), args = args) 5: f <- futureCall(function(x, y) { 6: a * (x - y) 7: }, args = args, globals = "a", lazy = lazy) 8: rm(list = c("a", "args")) 9: res <- tryCatch({ 10: v <- value(f) 11: }, error = identity) 12: stopifnot(!inherits(res, "FutureError")) 13: if (!inherits(res, "error")) { 14: stopifnot(all.equal(v, v0)) 15: } 16: else { 17: } 18: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: TRUE - Captured output: 1: '' - Success: TRUE - Processing time: 0.008 secs [[1]][[23]][[2]] TestResult: - Test: - Title: 'futureCall() - globals = "a"' - Tags: 'futureCall', 'lazy', 'globals', 'globals-by-name' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: a <- 3 3: args <- list(x = 42, y = 12) 4: v0 <- do.call(function(x, y) a * (x - y), args = args) 5: f <- futureCall(function(x, y) { 6: a * (x - y) 7: }, args = args, globals = "a", lazy = lazy) 8: rm(list = c("a", "args")) 9: res <- tryCatch({ 10: v <- value(f) 11: }, error = identity) 12: stopifnot(!inherits(res, "FutureError")) 13: if (!inherits(res, "error")) { 14: stopifnot(all.equal(v, v0)) 15: } 16: else { 17: } 18: } - Arguments tested: 1. lazy: TRUE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: TRUE - Captured output: 1: '' - Success: TRUE - Processing time: 0.008 secs [[1]][[24]] [[1]][[24]][[1]] TestResult: - Test: - Title: 'future() - rm() a global variable' - Tags: 'future', 'globalenv' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: a <- 42 3: f <- future({ 4: a 5: a <- 3.14 6: rm(a) 7: a 8: }, lazy = lazy) 9: rm(list = "a") 10: stopifnot(value(f) == 42L) 11: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.010 secs [[1]][[24]][[2]] TestResult: - Test: - Title: 'future() - rm() a global variable' - Tags: 'future', 'globalenv' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: a <- 42 3: f <- future({ 4: a 5: a <- 3.14 6: rm(a) 7: a 8: }, lazy = lazy) 9: rm(list = "a") 10: stopifnot(value(f) == 42L) 11: } - Arguments tested: 1. lazy: TRUE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.011 secs [[1]][[25]] [[1]][[25]][[1]] TestResult: - Test: - Title: 'future() - non-exported package objects' - Tags: 'future', 'globals' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: if (requireNamespace("utils") && require("utils")) { 3: env <- pos.to.env(match("package:utils", search())) 4: ns <- getNamespace("utils") 5: privates <- setdiff(names(ns), names(env)) 6: non_exported <- NULL 7: for (name in privates) { 8: if (exists(name, envir = ns, mode = "function", inherits = FALSE)) { 9: non_exported <- get(name, envir = ns, mode = "function", 10: inherits = FALSE) 11: } 12: } 13: stopifnot(is.function(non_exported)) 14: f <- future({ 15: non_exported 16: }, lazy = TRUE) 17: stopifnot("non_exported" %in% names(f$globals), identical(f$globals[["non_exported"]], 18: non_exported)) 19: v <- value(f) 20: stopifnot(identical(v, non_exported)) 21: } 22: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.072 secs [[1]][[26]] [[1]][[26]][[1]] TestResult: - Test: - Title: 'future() - NSE '...'' - Tags: 'future', 'globals', '...' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: my_fcn <- function(...) { 3: globals <- globals::globalsByName("...", envir = environment()) 4: f <- future({ 5: fcn <- function() sum(...) 6: fcn() 7: }, envir = parent.frame(), globals = globals) 8: v <- value(f) 9: v 10: } 11: y <- my_fcn() 12: stopifnot(y == 0L) 13: y <- my_fcn(1:10) 14: stopifnot(identical(y, 55L)) 15: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.015 secs [[1]][[27]] [[1]][[27]][[1]] TestResult: - Test: - Title: 'future() - global variables with and without lazy evaluation' - Tags: 'future', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: a <- 1 3: f <- future({ 4: 2 + a 5: }, lazy = lazy) 6: a <- 2 7: v <- value(f) 8: stopifnot(v == 3) 9: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.009 secs [[1]][[27]][[2]] TestResult: - Test: - Title: 'future() - global variables with and without lazy evaluation' - Tags: 'future', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: a <- 1 3: f <- future({ 4: 2 + a 5: }, lazy = lazy) 6: a <- 2 7: v <- value(f) 8: stopifnot(v == 3) 9: } - Arguments tested: 1. lazy: TRUE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.009 secs [[1]][[28]] [[1]][[28]][[1]] TestResult: - Test: - Title: 'resolved() on lazy futures' - Tags: 'resolved', 'lazy' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: f <- future(42, lazy = TRUE) 3: while (!resolved(f)) { 4: Sys.sleep(0.1) 5: } 6: v <- value(f) 7: stopifnot(identical(v, 42)) 8: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.007 secs [[1]][[29]] [[1]][[29]][[1]] TestResult: - Test: - Title: 'demo("mandelbrot", package = "future")' - Tags: 'demo', 'mandelbrot' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: if (getRversion() <= "3.2.0") { 3: message("Test requires R (>= 3.2.0). Skipping") 4: return() 5: } 6: options(future.demo.mandelbrot.nrow = 2L) 7: options(future.demo.mandelbrot.resolution = 50L) 8: options(future.demo.mandelbrot.delay = FALSE) 9: on.exit(grDevices::graphics.off()) 10: demo("mandelbrot", package = "future", ask = FALSE) 11: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: list(value = NULL, visible = FALSE) - Visible: FALSE - Captured output: 1: '' 2: '' 3: ' demo(mandelbrot)' 4: ' ---- ~~~~~~~~~~' 5: '' 6: '> library("future")' 7: '' 8: '> library("graphics")' 9: '' 10: '> plot_what_is_done <- function(counts) {' 11: '+ for (kk in seq_along(counts)) {' 12: '+ f <- counts[[kk]]' 13: '+ ' 14: '+ ## Already plotted?' 15: '+ if (!inherits(f, "Future")) next' 16: '+ ' 17: '+ ## Not resolved?' 18: '+ if (!resolved(f)) next' 19: '+ ' 20: '+ message(sprintf("Plotting tile #%d of %d ...", kk, n))' 21: '+ counts[[kk]] <- value(f)' 22: '+ screen(kk)' 23: '+ plot(counts[[kk]])' 24: '+ }' 25: '+ ' 26: '+ counts' 27: '+ }' 28: '' 29: '> ## Options' 30: '> region <- getOption("future.demo.mandelbrot.region", 1L)' 31: '' 32: '> if (!is.list(region)) {' 33: '+ if (region == 1L) {' 34: '+ region <- list(xmid = -0.75, ymid = 0.0, side = 3.0)' 35: '+ } else if (region == 2L) {' 36: '+ region <- list(xmid = 0.283, ymid = -0.0095, side = 0.00026)' 37: '+ } else if (region == 3L) {' 38: '+ region <- list(xmid = 0.282989, ymid = -0.01, side = 3e-8)' 39: '+ }' 40: '+ }' 41: '' 42: '> nrow <- getOption("future.demo.mandelbrot.nrow", 3L)' 43: '' 44: '> resolution <- getOption("future.demo.mandelbrot.resolution", 400L)' 45: '' 46: '> delay <- getOption("future.demo.mandelbrot.delay", interactive())' 47: '' 48: '> if (isTRUE(delay)) {' 49: '+ delay <- function(counts) Sys.sleep(1.0)' 50: '+ } else if (!is.function(delay)) {' 51: '+ delay <- function(counts) {}' 52: '+ }' 53: '' 54: '> ## Generate Mandelbrot tiles to be computed' 55: '> Cs <- mandelbrot_tiles(xmid = region$xmid, ymid = region$ymid,' 56: '+ side = region$side, nrow = nrow,' 57: '+ resolution = resolution)' 58: '' 59: '> if (interactive()) {' 60: '+ dev.new()' 61: '+ plot.new()' 62: '+ split.screen(dim(Cs))' 63: '+ for (ii in seq_along(Cs)) {' 64: '+ screen(ii)' 65: '+ par(mar = c(0, 0, 0, 0))' 66: '+ text(x = 1 / 2, y = 1 / 2, sprintf("Future #%d\nunresolved", ii), cex = 2)' 67: '+ }' 68: '+ } else {' 69: '+ split.screen(dim(Cs))' 70: '+ }' 71: '[1] 1 2 3 4' 72: '' 73: '> ## Create all Mandelbrot tiles via lazy futures' 74: '> n <- length(Cs)' 75: '' 76: '> message(sprintf("Creating %d Mandelbrot tiles:", n), appendLF = FALSE)' 77: '' 78: '> counts <- lapply(seq_along(Cs), FUN=function(ii) {' 79: '+ message(" ", ii, appendLF = FALSE)' 80: '+ C <- Cs[[ii]]' 81: '+ future({' 82: '+ message(sprintf("Calculating tile #%d of %d ...", ii, n), appendLF = FALSE)' 83: '+ fit <- mandelbrot(C)' 84: '+ ' 85: '+ ## Emulate slowness' 86: '+ delay(fit)' 87: '+ ' 88: '+ message(" done")' 89: '+ fit' 90: '+ }, lazy = TRUE)' 91: '+ })' 92: '' 93: '> message(".")' 94: '' 95: '> ## Calculate and plot tiles' 96: '> repeat {' 97: '+ counts <- plot_what_is_done(counts)' 98: '+ if (!any(sapply(counts, FUN = inherits, "Future"))) break' 99: '+ }' 100: '' 101: '> close.screen()' 102: '[1] 1 2 3 4' 103: '' 104: '> message("SUGGESTION: Try to rerun this demo after changing strategy for how futures are resolved, e.g. plan(multisession).\n")' - Success: TRUE - Processing time: 0.320 secs [[1]][[29]][[2]] TestResult: - Test: - Title: 'demo("mandelbrot", package = "future")' - Tags: 'demo', 'mandelbrot' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: if (getRversion() <= "3.2.0") { 3: message("Test requires R (>= 3.2.0). Skipping") 4: return() 5: } 6: options(future.demo.mandelbrot.nrow = 2L) 7: options(future.demo.mandelbrot.resolution = 50L) 8: options(future.demo.mandelbrot.delay = FALSE) 9: on.exit(grDevices::graphics.off()) 10: demo("mandelbrot", package = "future", ask = FALSE) 11: } - Arguments tested: 1. lazy: TRUE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: list(value = NULL, visible = FALSE) - Visible: FALSE - Captured output: 1: '' 2: '' 3: ' demo(mandelbrot)' 4: ' ---- ~~~~~~~~~~' 5: '' 6: '> library("future")' 7: '' 8: '> library("graphics")' 9: '' 10: '> plot_what_is_done <- function(counts) {' 11: '+ for (kk in seq_along(counts)) {' 12: '+ f <- counts[[kk]]' 13: '+ ' 14: '+ ## Already plotted?' 15: '+ if (!inherits(f, "Future")) next' 16: '+ ' 17: '+ ## Not resolved?' 18: '+ if (!resolved(f)) next' 19: '+ ' 20: '+ message(sprintf("Plotting tile #%d of %d ...", kk, n))' 21: '+ counts[[kk]] <- value(f)' 22: '+ screen(kk)' 23: '+ plot(counts[[kk]])' 24: '+ }' 25: '+ ' 26: '+ counts' 27: '+ }' 28: '' 29: '> ## Options' 30: '> region <- getOption("future.demo.mandelbrot.region", 1L)' 31: '' 32: '> if (!is.list(region)) {' 33: '+ if (region == 1L) {' 34: '+ region <- list(xmid = -0.75, ymid = 0.0, side = 3.0)' 35: '+ } else if (region == 2L) {' 36: '+ region <- list(xmid = 0.283, ymid = -0.0095, side = 0.00026)' 37: '+ } else if (region == 3L) {' 38: '+ region <- list(xmid = 0.282989, ymid = -0.01, side = 3e-8)' 39: '+ }' 40: '+ }' 41: '' 42: '> nrow <- getOption("future.demo.mandelbrot.nrow", 3L)' 43: '' 44: '> resolution <- getOption("future.demo.mandelbrot.resolution", 400L)' 45: '' 46: '> delay <- getOption("future.demo.mandelbrot.delay", interactive())' 47: '' 48: '> if (isTRUE(delay)) {' 49: '+ delay <- function(counts) Sys.sleep(1.0)' 50: '+ } else if (!is.function(delay)) {' 51: '+ delay <- function(counts) {}' 52: '+ }' 53: '' 54: '> ## Generate Mandelbrot tiles to be computed' 55: '> Cs <- mandelbrot_tiles(xmid = region$xmid, ymid = region$ymid,' 56: '+ side = region$side, nrow = nrow,' 57: '+ resolution = resolution)' 58: '' 59: '> if (interactive()) {' 60: '+ dev.new()' 61: '+ plot.new()' 62: '+ split.screen(dim(Cs))' 63: '+ for (ii in seq_along(Cs)) {' 64: '+ screen(ii)' 65: '+ par(mar = c(0, 0, 0, 0))' 66: '+ text(x = 1 / 2, y = 1 / 2, sprintf("Future #%d\nunresolved", ii), cex = 2)' 67: '+ }' 68: '+ } else {' 69: '+ split.screen(dim(Cs))' 70: '+ }' 71: '[1] 1 2 3 4' 72: '' 73: '> ## Create all Mandelbrot tiles via lazy futures' 74: '> n <- length(Cs)' 75: '' 76: '> message(sprintf("Creating %d Mandelbrot tiles:", n), appendLF = FALSE)' 77: '' 78: '> counts <- lapply(seq_along(Cs), FUN=function(ii) {' 79: '+ message(" ", ii, appendLF = FALSE)' 80: '+ C <- Cs[[ii]]' 81: '+ future({' 82: '+ message(sprintf("Calculating tile #%d of %d ...", ii, n), appendLF = FALSE)' 83: '+ fit <- mandelbrot(C)' 84: '+ ' 85: '+ ## Emulate slowness' 86: '+ delay(fit)' 87: '+ ' 88: '+ message(" done")' 89: '+ fit' 90: '+ }, lazy = TRUE)' 91: '+ })' 92: '' 93: '> message(".")' 94: '' 95: '> ## Calculate and plot tiles' 96: '> repeat {' 97: '+ counts <- plot_what_is_done(counts)' 98: '+ if (!any(sapply(counts, FUN = inherits, "Future"))) break' 99: '+ }' 100: '' 101: '> close.screen()' 102: '[1] 1 2 3 4' 103: '' 104: '> message("SUGGESTION: Try to rerun this demo after changing strategy for how futures are resolved, e.g. plan(multisession).\n")' - Success: TRUE - Processing time: 0.163 secs [[1]][[30]] [[1]][[30]][[1]] TestResult: - Test: - Title: 'nbrOfWorkers()' - Tags: 'nbrOfWorkers' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: n <- nbrOfWorkers() 3: message(sprintf("nbrOfWorkers: %g", n)) 4: stopifnot(is.numeric(n), length(n) == 1L, n >= 1L) 5: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.001 secs [[1]][[31]] [[1]][[31]][[1]] TestResult: - Test: - Title: 'future() - preserve R options (data.table)' - Tags: 'future', 'options', 'reset', 'data.table' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: if (requireNamespace("data.table")) { 3: data.table <- data.table::data.table 4: for (kk in 1:2) { 5: f <- future(data.table()) 6: v <- value(f) 7: print(v) 8: stopifnot(inherits(v, "data.frame"), inherits(v, 9: "data.table"), nrow(v) == 0L, ncol(v) == 0L) 10: } 11: } 12: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: 'Null data.table (0 rows and 0 cols)' 2: 'Null data.table (0 rows and 0 cols)' - Success: TRUE - Processing time: 0.116 secs [[1]][[32]] [[1]][[32]][[1]] TestResult: - Test: - Title: 'future() - 'data.table' inject' - Tags: 'future', 'options', 'reset', 'ff' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: if (!requireNamespace("data.table")) { 3: future.tests::skip_test("Test requires the 'data.table' package") 4: } 5: dt <- data.table::data.table 6: f <- future(dt, packages = "data.table") 7: r <- result(f) 8: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: structure(list(value = function (..., keep.rownames = FALSE, , check.names = FALSE, key = NULL, stringsAsFactors = FALSE) , {, x = list(...), nd = name_dots(...), names(x) = nd$vnames, if (length(x) == 0L) , return(null.data.table()), if (length(x) == 1L && (is.null(x[[1L]]) || (is.list(x[[1L]]) && , length(x[[1L]]) == 0L))) , return(null.data.table()), ans = as.data.table.list(x, keep.rownames = keep.rownames, , check.names = check.names, .named = nd$.named), if (!is.null(key)) {, if (!is.character(key)) , stopf("key argument of data.table() must be character"), if (length(key) == 1L) , key = cols_from_csv(key), setkeyv(ans, key), }, else {, ckey = NULL, for (i in seq_along(x)) {, xi = x[[i]], if (is.data.table(xi) && haskey(xi) && nrow(xi) == , nrow(ans)) , ckey = c(ckey, key(xi)), }, if (length(ckey) && !anyDuplicated(ckey) && identical(is.na(chmatchdup(c(ckey, , ckey), names(ans))), rep(c(FALSE, TRUE), each = length(ckey)))) {, setattr(ans, "sorted", ckey), }, }, if (isTRUE(stringsAsFactors)) {, for (j in which(vapply_1b(ans, is.character))) set(ans, , NULL, j, as_factor(.subset2(ans, j))), }, setalloccol(ans), }, visible = TRUE, stdout = "", conditions = list(), rng = FALSE, , globalenv = NULL, started = structure(1743398536.4033, class = c("POSIXct", , "POSIXt")), finished = structure(1743398536.41429, class = c("POSIXct", , "POSIXt")), session_uuid = structure("06c6277d-6ec9-2e58-f4db-3d8c1a0b16a0", source = list(, host = c(COMPUTERNAME = "CRANWIN3"), info = c(sysname = "Windows", , release = "Server x64", version = "build 20348", nodename = "CRANWIN3", , machine = "x86-64", login = "CRAN", user = "CRAN", effective_user = "CRAN", , udomain = "CRANWIN3"), pid = 67716L, time = structure(1743398531.94982, class = c("POSIXct", , "POSIXt")), random = 2147483647L)), r_info = list(version = structure(list(, c(4L, 5L, 0L)), class = c("R_system_version", "package_version", , "numeric_version")), os = "windows", os_name = "Windows", , captures_utf8 = TRUE), version = "1.8"), class = "FutureResult") - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.033 secs [[1]][[33]] [[1]][[33]][[1]] TestResult: - Test: - Title: 'future() - can load 'ff' package' - Tags: 'future', 'options', 'reset', 'ff' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: if (!requireNamespace("ff")) { 3: future.tests::skip_test("Test requires the 'ff' package") 4: } 5: f <- future(requireNamespace("ff")) 6: v <- value(f) 7: message(sprintf("Package 'ff' loaded on worker: %s", v)) 8: if (!isTRUE(v)) 9: stop("Failed to load 'ff' package") 10: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.054 secs [[1]][[34]] [[1]][[34]][[1]] TestResult: - Test: - Title: 'future() - can attach 'ff' package' - Tags: 'future', 'options', 'reset', 'ff' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: if (!requireNamespace("ff")) { 3: future.tests::skip_test("Test requires the 'ff' package") 4: } 5: f <- future(require("ff")) 6: v <- value(f) 7: message(sprintf("Package 'ff' attached on worker: %s", v)) 8: if (!isTRUE(v)) 9: stop("Failed to attach 'ff' package") 10: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.058 secs [[1]][[35]] [[1]][[35]][[1]] TestResult: - Test: - Title: 'future() - preserve R options (ff)' - Tags: 'future', 'options', 'reset', 'ff' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: if (!requireNamespace("ff")) { 3: future.tests::skip_test("Test requires the 'ff' package") 4: } 5: info <- Sys.info() 6: is_localhost <- value(future(identical(Sys.info(), info))) 7: if (!is_localhost) { 8: future.tests::skip_test("Test only valid on localhost workers") 9: } 10: data <- ff::ff(1:12) 11: for (kk in 1:2) { 12: cat(sprintf("kk = %d ...\n", kk)) 13: stopifnot(is.character(getOption("fftempdir"))) 14: cat("Future #1:\n") 15: f <- future({ 16: if (!"ff" %in% loadedNamespaces()) 17: loadNamespace("ff") 18: ns <- loadedNamespaces() 19: cat(sprintf("loadedNamespaces(): [n=%d] %s\n", length(ns), 20: paste(sQuote(ns), collapse = ", "))) 21: data[4] 22: }) 23: v <- value(f) 24: message(sprintf("v = %s", v)) 25: stopifnot(is.character(getOption("fftempdir"))) 26: cat("Future #2:\n") 27: f <- future(requireNamespace("ff")) 28: v <- value(f) 29: message(sprintf("Package 'ff' loaded on worker: %s", 30: v)) 31: if (!isTRUE(v)) 32: stop("Failing to load 'ff' package in future") 33: stopifnot(is.character(getOption("fftempdir"))) 34: cat("Future #3:\n") 35: f <- future(require("ff")) 36: v <- value(f) 37: message(sprintf("Package 'ff' attached on worker: %s", 38: v)) 39: if (!isTRUE(v)) 40: stop("Failing to attach 'ff' package in future") 41: stopifnot(is.character(getOption("fftempdir"))) 42: cat("Future #4:\n") 43: f <- future(data[4], packages = "ff") 44: v <- value(f) 45: message(sprintf("v = %s", v)) 46: stopifnot(is.integer(v), length(v) == 1L, identical(v, 47: 4L)) 48: cat(sprintf("kk = %d ... done\n", kk)) 49: } 50: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: 'kk = 1 ...' 2: 'Future #1:' 3: 'loadedNamespaces(): [n=24] 'bit', 'compiler', 'parallelly', 'cli', 'graphics', 'prettyunits', 'tools', 'parallel', 'future.tests', 'utils', 'listenv', 'grDevices', 'crayon', 'stats', 'datasets', 'codetools', 'data.table', 'methods', 'digest', 'globals', 'ff', 'base', 'sessioninfo', 'future'' 4: 'Future #2:' 5: 'Future #3:' 6: 'Future #4:' 7: 'kk = 1 ... done' 8: 'kk = 2 ...' 9: 'Future #1:' 10: 'loadedNamespaces(): [n=24] 'bit', 'compiler', 'parallelly', 'cli', 'graphics', 'prettyunits', 'tools', 'parallel', 'future.tests', 'utils', 'listenv', 'grDevices', 'crayon', 'stats', 'datasets', 'codetools', 'data.table', 'methods', 'digest', 'globals', 'ff', 'base', 'sessioninfo', 'future'' 11: 'Future #2:' 12: 'Future #3:' 13: 'Future #4:' 14: 'kk = 2 ... done' - Success: TRUE - Processing time: 0.056 secs [[1]][[36]] [[1]][[36]][[1]] TestResult: - Test: - Title: 'plan()' - Tags: 'plan' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: current_plan <- plan() 3: print(current_plan) 4: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: structure(function (..., envir = parent.frame()) , {, future <- SequentialFuture(..., envir = envir), if (!future$lazy) , future <- run(future), invisible(future), }, class = c("FutureStrategy", "sequential", "uniprocess", "future", , "function"), call = plan(sequential)) - Visible: FALSE - Captured output: 1: 'sequential:' 2: '- args: function (..., envir = parent.frame(), workers = "")' 3: '- tweaked: FALSE' 4: '- call: plan(sequential)' - Success: TRUE - Processing time: 0.001 secs [[1]][[37]] [[1]][[37]][[1]] TestResult: - Test: - Title: 'plan() - workers=' - Tags: 'plan', 'workers' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: current_plan <- plan() 3: if (!"workers" %in% names(formals(current_plan))) { 4: future.tests::skip_test() 5: return() 6: } 7: plan(current_plan, workers = 1L) 8: n <- nbrOfWorkers() 9: cat(sprintf("Number of workers: %g\n", n)) 10: stopifnot(n == 1L) 11: f <- future(42L) 12: stopifnot(value(f) == 42L) 13: plan(current_plan, workers = 2L) 14: n <- nbrOfWorkers() 15: cat(sprintf("Number of workers: %g\n", n)) 16: stopifnot(n == 2L) 17: f <- future(42L) 18: stopifnot(value(f) == 42L) 19: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Skipped: Test skipped - Captured output: 1: '' - Success: NA - Processing time: 0.001 secs [[1]][[38]] [[1]][[38]][[1]] TestResult: - Test: - Title: 'plan() - workers=' - Tags: 'plan', 'workers', 'function' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: current_plan <- plan() 3: if (!"workers" %in% names(formals(current_plan))) { 4: future.tests::skip_test() 5: return() 6: } 7: n0 <- nbrOfWorkers() 8: cat(sprintf("Number of initial workers: %g\n", n0)) 9: workers_value <- eval(formals(current_plan)$workers) 10: workers <- function() workers_value 11: if (is.character(workers_value)) { 12: nworkers <- length(workers_value) 13: } 14: else { 15: nworkers <- workers_value 16: } 17: cat(sprintf("Number of workers according to plan(): %g\n", 18: nworkers)) 19: plan(current_plan, workers = workers) 20: n <- nbrOfWorkers() 21: cat(sprintf("Number of workers: %g\n", n)) 22: stopifnot(n == nworkers) 23: f <- future(42L) 24: stopifnot(value(f) == 42L) 25: workers <- function() 1L 26: plan(current_plan, workers = workers) 27: n <- nbrOfWorkers() 28: cat(sprintf("Number of workers: %g\n", n)) 29: stopifnot(n == 1L) 30: f <- future(42L) 31: stopifnot(value(f) == 42L) 32: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Skipped: Test skipped - Captured output: 1: '' - Success: NA - Processing time: 0.001 secs [[1]][[39]] [[1]][[39]][[1]] TestResult: - Test: - Title: 'plan() - workers=' - Tags: 'plan', 'workers', 'exceptions' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: current_plan <- plan() 3: if (!"workers" %in% names(formals(current_plan))) { 4: future.tests::skip_test() 5: return() 6: } 7: res <- tryCatch({ 8: plan(current_plan, workers = 0L) 9: }, error = identity) 10: print(res) 11: stopifnot(inherits(res, "error")) 12: res <- tryCatch({ 13: plan(current_plan, workers = NA_integer_) 14: }, error = identity) 15: print(res) 16: stopifnot(inherits(res, "error")) 17: res <- tryCatch({ 18: plan(current_plan, workers = TRUE) 19: }, error = identity) 20: print(res) 21: stopifnot(inherits(res, "error")) 22: res <- tryCatch({ 23: plan(current_plan, workers = NA_character_) 24: }, error = identity) 25: print(res) 26: stopifnot(inherits(res, "error")) 27: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Skipped: Test skipped - Captured output: 1: '' - Success: NA - Processing time: 0.001 secs [[1]][[40]] [[1]][[40]][[1]] TestResult: - Test: - Title: 'resolve()' - Tags: 'resolve', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. result: [n = 2] c(FALSE, TRUE) 3. recursive: [n = 2] c(FALSE, TRUE) => Test combinations: 8 (= 2*2*2) - Expression: 1: { 2: f <- future({ 3: Sys.sleep(0.5) 4: list(a = 1, b = 42L) 5: }, lazy = lazy) 6: res <- resolve(f, result = result, recursive = recursive) 7: stopifnot(identical(res, f)) 8: } - Arguments tested: 1. lazy: FALSE 2. result: FALSE 3. recursive: FALSE 4. globals: TRUE 5. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.526 secs [[1]][[40]][[2]] TestResult: - Test: - Title: 'resolve()' - Tags: 'resolve', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. result: [n = 2] c(FALSE, TRUE) 3. recursive: [n = 2] c(FALSE, TRUE) => Test combinations: 8 (= 2*2*2) - Expression: 1: { 2: f <- future({ 3: Sys.sleep(0.5) 4: list(a = 1, b = 42L) 5: }, lazy = lazy) 6: res <- resolve(f, result = result, recursive = recursive) 7: stopifnot(identical(res, f)) 8: } - Arguments tested: 1. lazy: TRUE 2. result: FALSE 3. recursive: FALSE 4. globals: TRUE 5. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.513 secs [[1]][[40]][[3]] TestResult: - Test: - Title: 'resolve()' - Tags: 'resolve', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. result: [n = 2] c(FALSE, TRUE) 3. recursive: [n = 2] c(FALSE, TRUE) => Test combinations: 8 (= 2*2*2) - Expression: 1: { 2: f <- future({ 3: Sys.sleep(0.5) 4: list(a = 1, b = 42L) 5: }, lazy = lazy) 6: res <- resolve(f, result = result, recursive = recursive) 7: stopifnot(identical(res, f)) 8: } - Arguments tested: 1. lazy: FALSE 2. result: TRUE 3. recursive: FALSE 4. globals: TRUE 5. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.516 secs [[1]][[40]][[4]] TestResult: - Test: - Title: 'resolve()' - Tags: 'resolve', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. result: [n = 2] c(FALSE, TRUE) 3. recursive: [n = 2] c(FALSE, TRUE) => Test combinations: 8 (= 2*2*2) - Expression: 1: { 2: f <- future({ 3: Sys.sleep(0.5) 4: list(a = 1, b = 42L) 5: }, lazy = lazy) 6: res <- resolve(f, result = result, recursive = recursive) 7: stopifnot(identical(res, f)) 8: } - Arguments tested: 1. lazy: TRUE 2. result: TRUE 3. recursive: FALSE 4. globals: TRUE 5. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.515 secs [[1]][[40]][[5]] TestResult: - Test: - Title: 'resolve()' - Tags: 'resolve', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. result: [n = 2] c(FALSE, TRUE) 3. recursive: [n = 2] c(FALSE, TRUE) => Test combinations: 8 (= 2*2*2) - Expression: 1: { 2: f <- future({ 3: Sys.sleep(0.5) 4: list(a = 1, b = 42L) 5: }, lazy = lazy) 6: res <- resolve(f, result = result, recursive = recursive) 7: stopifnot(identical(res, f)) 8: } - Arguments tested: 1. lazy: FALSE 2. result: FALSE 3. recursive: TRUE 4. globals: TRUE 5. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.515 secs [[1]][[40]][[6]] TestResult: - Test: - Title: 'resolve()' - Tags: 'resolve', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. result: [n = 2] c(FALSE, TRUE) 3. recursive: [n = 2] c(FALSE, TRUE) => Test combinations: 8 (= 2*2*2) - Expression: 1: { 2: f <- future({ 3: Sys.sleep(0.5) 4: list(a = 1, b = 42L) 5: }, lazy = lazy) 6: res <- resolve(f, result = result, recursive = recursive) 7: stopifnot(identical(res, f)) 8: } - Arguments tested: 1. lazy: TRUE 2. result: FALSE 3. recursive: TRUE 4. globals: TRUE 5. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.530 secs [[1]][[40]][[7]] TestResult: - Test: - Title: 'resolve()' - Tags: 'resolve', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. result: [n = 2] c(FALSE, TRUE) 3. recursive: [n = 2] c(FALSE, TRUE) => Test combinations: 8 (= 2*2*2) - Expression: 1: { 2: f <- future({ 3: Sys.sleep(0.5) 4: list(a = 1, b = 42L) 5: }, lazy = lazy) 6: res <- resolve(f, result = result, recursive = recursive) 7: stopifnot(identical(res, f)) 8: } - Arguments tested: 1. lazy: FALSE 2. result: TRUE 3. recursive: TRUE 4. globals: TRUE 5. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.517 secs [[1]][[40]][[8]] TestResult: - Test: - Title: 'resolve()' - Tags: 'resolve', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. result: [n = 2] c(FALSE, TRUE) 3. recursive: [n = 2] c(FALSE, TRUE) => Test combinations: 8 (= 2*2*2) - Expression: 1: { 2: f <- future({ 3: Sys.sleep(0.5) 4: list(a = 1, b = 42L) 5: }, lazy = lazy) 6: res <- resolve(f, result = result, recursive = recursive) 7: stopifnot(identical(res, f)) 8: } - Arguments tested: 1. lazy: TRUE 2. result: TRUE 3. recursive: TRUE 4. globals: TRUE 5. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.507 secs [[1]][[41]] [[1]][[41]][[1]] TestResult: - Test: - Title: 'resolve() - run-time exception' - Tags: 'resolve', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. result: [n = 2] c(FALSE, TRUE) 3. recursive: [n = 2] c(FALSE, TRUE) => Test combinations: 8 (= 2*2*2) - Expression: 1: { 2: f <- future(list(a = 1, b = 42L, c = stop("Nah!")), lazy = lazy) 3: res <- resolve(f, result = result, recursive = recursive) 4: stopifnot(identical(res, f)) 5: } - Arguments tested: 1. lazy: FALSE 2. result: FALSE 3. recursive: FALSE 4. globals: TRUE 5. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.008 secs [[1]][[41]][[2]] TestResult: - Test: - Title: 'resolve() - run-time exception' - Tags: 'resolve', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. result: [n = 2] c(FALSE, TRUE) 3. recursive: [n = 2] c(FALSE, TRUE) => Test combinations: 8 (= 2*2*2) - Expression: 1: { 2: f <- future(list(a = 1, b = 42L, c = stop("Nah!")), lazy = lazy) 3: res <- resolve(f, result = result, recursive = recursive) 4: stopifnot(identical(res, f)) 5: } - Arguments tested: 1. lazy: TRUE 2. result: FALSE 3. recursive: FALSE 4. globals: TRUE 5. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.009 secs [[1]][[41]][[3]] TestResult: - Test: - Title: 'resolve() - run-time exception' - Tags: 'resolve', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. result: [n = 2] c(FALSE, TRUE) 3. recursive: [n = 2] c(FALSE, TRUE) => Test combinations: 8 (= 2*2*2) - Expression: 1: { 2: f <- future(list(a = 1, b = 42L, c = stop("Nah!")), lazy = lazy) 3: res <- resolve(f, result = result, recursive = recursive) 4: stopifnot(identical(res, f)) 5: } - Arguments tested: 1. lazy: FALSE 2. result: TRUE 3. recursive: FALSE 4. globals: TRUE 5. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.009 secs [[1]][[41]][[4]] TestResult: - Test: - Title: 'resolve() - run-time exception' - Tags: 'resolve', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. result: [n = 2] c(FALSE, TRUE) 3. recursive: [n = 2] c(FALSE, TRUE) => Test combinations: 8 (= 2*2*2) - Expression: 1: { 2: f <- future(list(a = 1, b = 42L, c = stop("Nah!")), lazy = lazy) 3: res <- resolve(f, result = result, recursive = recursive) 4: stopifnot(identical(res, f)) 5: } - Arguments tested: 1. lazy: TRUE 2. result: TRUE 3. recursive: FALSE 4. globals: TRUE 5. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.009 secs [[1]][[41]][[5]] TestResult: - Test: - Title: 'resolve() - run-time exception' - Tags: 'resolve', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. result: [n = 2] c(FALSE, TRUE) 3. recursive: [n = 2] c(FALSE, TRUE) => Test combinations: 8 (= 2*2*2) - Expression: 1: { 2: f <- future(list(a = 1, b = 42L, c = stop("Nah!")), lazy = lazy) 3: res <- resolve(f, result = result, recursive = recursive) 4: stopifnot(identical(res, f)) 5: } - Arguments tested: 1. lazy: FALSE 2. result: FALSE 3. recursive: TRUE 4. globals: TRUE 5. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.009 secs [[1]][[41]][[6]] TestResult: - Test: - Title: 'resolve() - run-time exception' - Tags: 'resolve', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. result: [n = 2] c(FALSE, TRUE) 3. recursive: [n = 2] c(FALSE, TRUE) => Test combinations: 8 (= 2*2*2) - Expression: 1: { 2: f <- future(list(a = 1, b = 42L, c = stop("Nah!")), lazy = lazy) 3: res <- resolve(f, result = result, recursive = recursive) 4: stopifnot(identical(res, f)) 5: } - Arguments tested: 1. lazy: TRUE 2. result: FALSE 3. recursive: TRUE 4. globals: TRUE 5. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.008 secs [[1]][[41]][[7]] TestResult: - Test: - Title: 'resolve() - run-time exception' - Tags: 'resolve', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. result: [n = 2] c(FALSE, TRUE) 3. recursive: [n = 2] c(FALSE, TRUE) => Test combinations: 8 (= 2*2*2) - Expression: 1: { 2: f <- future(list(a = 1, b = 42L, c = stop("Nah!")), lazy = lazy) 3: res <- resolve(f, result = result, recursive = recursive) 4: stopifnot(identical(res, f)) 5: } - Arguments tested: 1. lazy: FALSE 2. result: TRUE 3. recursive: TRUE 4. globals: TRUE 5. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.008 secs [[1]][[41]][[8]] TestResult: - Test: - Title: 'resolve() - run-time exception' - Tags: 'resolve', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) 2. result: [n = 2] c(FALSE, TRUE) 3. recursive: [n = 2] c(FALSE, TRUE) => Test combinations: 8 (= 2*2*2) - Expression: 1: { 2: f <- future(list(a = 1, b = 42L, c = stop("Nah!")), lazy = lazy) 3: res <- resolve(f, result = result, recursive = recursive) 4: stopifnot(identical(res, f)) 5: } - Arguments tested: 1. lazy: TRUE 2. result: TRUE 3. recursive: TRUE 4. globals: TRUE 5. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.006 secs [[1]][[42]] [[1]][[42]][[1]] TestResult: - Test: - Title: 'resolve()' - Tags: 'resolve', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: x <- list() 3: x$a <- future(1, lazy = lazy) 4: x$b <- future(2, lazy = lazy) 5: x[[3]] <- 3 6: y <- resolve(x) 7: stopifnot(identical(y, x)) 8: stopifnot(resolved(x$a)) 9: stopifnot(resolved(x[["b"]])) 10: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.008 secs [[1]][[42]][[2]] TestResult: - Test: - Title: 'resolve()' - Tags: 'resolve', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: x <- list() 3: x$a <- future(1, lazy = lazy) 4: x$b <- future(2, lazy = lazy) 5: x[[3]] <- 3 6: y <- resolve(x) 7: stopifnot(identical(y, x)) 8: stopifnot(resolved(x$a)) 9: stopifnot(resolved(x[["b"]])) 10: } - Arguments tested: 1. lazy: TRUE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.010 secs [[1]][[43]] [[1]][[43]][[1]] TestResult: - Test: - Title: 'resolve()' - Tags: 'resolve', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: x <- list() 3: x$a <- future(1, lazy = lazy) 4: x$b <- future(2, lazy = !lazy) 5: x[[3]] <- 3 6: y <- resolve(x) 7: stopifnot(identical(y, x)) 8: stopifnot(resolved(x$a)) 9: stopifnot(resolved(x[["b"]])) 10: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.012 secs [[1]][[43]][[2]] TestResult: - Test: - Title: 'resolve()' - Tags: 'resolve', 'lazy' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: x <- list() 3: x$a <- future(1, lazy = lazy) 4: x$b <- future(2, lazy = !lazy) 5: x[[3]] <- 3 6: y <- resolve(x) 7: stopifnot(identical(y, x)) 8: stopifnot(resolved(x$a)) 9: stopifnot(resolved(x[["b"]])) 10: } - Arguments tested: 1. lazy: TRUE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.015 secs [[1]][[44]] [[1]][[44]][[1]] TestResult: - Test: - Title: 'resolve() - time ordering' - Tags: 'resolve', 'lazy' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: x <- list() 3: x$a <- future(1) 4: x$b <- future({ 5: Sys.sleep(0.5) 6: 2 7: }) 8: x[[4]] <- 4 9: dim(x) <- c(2, 2) 10: y <- resolve(x, idxs = 1) 11: stopifnot(identical(y, x)) 12: stopifnot(resolved(x[[1]])) 13: y <- resolve(x, idxs = 2) 14: stopifnot(identical(y, x)) 15: stopifnot(resolved(x[[2]])) 16: y <- resolve(x, idxs = 3) 17: stopifnot(identical(y, x)) 18: y <- resolve(x, idxs = seq_along(x)) 19: stopifnot(identical(y, x)) 20: y <- resolve(x, idxs = names(x)) 21: stopifnot(identical(y, x)) 22: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.521 secs [[1]][[45]] [[1]][[45]][[1]] TestResult: - Test: - Title: 'resolved() - assert non-blocking while launching lazy futures' - Tags: 'resolved', 'lazy' - Reset workers: TRUE - Arguments: => Test combinations: 1 - Expression: 1: { 2: message("Creating lazy futures:") 3: if (!is.finite(nbrOfWorkers())) { 4: future.tests::skip_test("Test requires a finite number of workers") 5: } 6: n <- min(3L, nbrOfWorkers() + 1L) 7: xs <- as.list(1:n) 8: fs <- lapply(xs, FUN = function(kk) { 9: future({ 10: Sys.sleep(kk) 11: kk 12: }, lazy = TRUE) 13: }) 14: vs <- vector("list", length = length(fs)) 15: ss <- vapply(fs, FUN = function(f) f$state, NA_character_) 16: print(ss) 17: stopifnot(all(ss == "created")) 18: rs <- rep(NA, times = length(fs)) 19: for (ff in seq_along(fs)) { 20: for (kk in ff:length(fs)) { 21: message(sprintf("Checking if future #%d is resolved:", 22: kk)) 23: rs[[kk]] <- resolved(fs[[kk]]) 24: ss <- vapply(fs, FUN = function(f) f$state, NA_character_) 25: utils::str(list(ff = ff, kk = kk, ss = ss, rs = rs)) 26: nbrOfFinished <- sum(ss == "finished") 27: if (inherits(fs[[kk]], "UniprocessFuture")) { 28: stopifnot(rs[[kk]], ss[[kk]] == "finished") 29: } 30: else if (inherits(fs[[kk]], "MultiprocessFuture")) { 31: stopifnot((!rs[[kk]] && ss[[kk]] == "running") || 32: (rs[[kk]] && ss[[kk]] == "finished")) 33: } 34: } 35: if (ff == 1L && inherits(fs[[1]], "MultiprocessFuture")) { 36: stopifnot(!rs[[kk]]) 37: } 38: message(sprintf("Waiting for future #%d to finish ... ", 39: ff), appendLF = FALSE) 40: vs[[ff]] <- value(fs[[ff]]) 41: message("done") 42: rs[[ff]] <- resolved(fs[[ff]]) 43: stopifnot(rs[ff]) 44: ss <- vapply(fs, FUN = function(f) f$state, NA_character_) 45: stopifnot(ss[ff] == "finished") 46: nbrOfFinished <- sum(ss == "finished") 47: if (inherits(fs[[kk]], "UniprocessFuture")) { 48: stopifnot(nbrOfFinished == length(fs)) 49: } 50: else { 51: stopifnot(nbrOfFinished >= ff) 52: } 53: } 54: ss <- vapply(fs, FUN = function(f) f$state, NA_character_) 55: print(ss) 56: stopifnot(all(ss == "finished")) 57: message("Collecting values:") 58: vs <- value(fs) 59: str(vs) 60: stopifnot(identical(vs, xs)) 61: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '[1] "created" "created"' 2: 'List of 4' 3: ' $ ff: int 1' 4: ' $ kk: int 1' 5: ' $ ss: chr [1:2] "finished" "created"' 6: ' $ rs: logi [1:2] TRUE NA' 7: 'List of 4' 8: ' $ ff: int 1' 9: ' $ kk: int 2' 10: ' $ ss: chr [1:2] "finished" "finished"' 11: ' $ rs: logi [1:2] TRUE TRUE' 12: 'List of 4' 13: ' $ ff: int 2' 14: ' $ kk: int 2' 15: ' $ ss: chr [1:2] "finished" "finished"' 16: ' $ rs: logi [1:2] TRUE TRUE' 17: '[1] "finished" "finished"' 18: 'List of 2' 19: ' $ : int 1' 20: ' $ : int 2' - Success: TRUE - Processing time: 3.117 secs [[1]][[46]] [[1]][[46]][[1]] TestResult: - Test: - Title: 'Random Number Generation (RNG) - seeds and preserving RNGkind' - Tags: 'rng', 'seed' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: okind <- RNGkind() 3: seed <- c(407L, 1420090545L, 65713854L, -990249945L, 1780737596L, 4: -1213437427L, 1082168682L) 5: f <- future(42, seed = seed) 6: print(f) 7: stopifnot(identical(f$seed, seed)) 8: stopifnot(identical(RNGkind()[1], okind[1])) 9: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: 'SequentialFuture:' 2: 'Label: ''' 3: 'Expression:' 4: '[1] 42' 5: 'Lazy evaluation: FALSE' 6: 'Asynchronous evaluation: FALSE' 7: 'Local evaluation: TRUE' 8: 'Environment: 0x000002954a8b7338' 9: 'Capture standard output: TRUE' 10: 'Capture condition classes: 'condition' (excluding 'nothing')' 11: 'Globals: ' 12: 'Packages: ' 13: 'L'Ecuyer-CMRG RNG seed: c(407, 1420090545, 65713854, -990249945, 1780737596, -1213437427, 1082168682)' 14: 'Resolved: TRUE' 15: 'Value: 39 bytes of class 'numeric'' 16: 'Early signaling: FALSE' 17: 'Owner process: 06c6277d-6ec9-2e58-f4db-3d8c1a0b16a0' 18: 'Class: 'SequentialFuture', 'UniprocessFuture', 'Future', 'environment'' - Success: TRUE - Processing time: 0.011 secs [[1]][[47]] [[1]][[47]][[1]] TestResult: - Test: - Title: 'Random Number Generation (RNG) - future' - Tags: 'rng', 'seed', 'lazy', 'future' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: fsample <- function (x, size = 2L, seed = NULL, what = c("future", 3: "%<-%"), lazy = FALSE) 4: { 5: what <- match.arg(what) 6: .GlobalEnv <- globalenv() 7: oseed <- .GlobalEnv$.Random.seed 8: orng <- RNGkind("L'Ecuyer-CMRG")[1L] 9: on.exit(RNGkind(orng)) 10: if (!is.null(seed)) { 11: on.exit({ 12: if (is.null(oseed)) { 13: rm(list = ".Random.seed", envir = .GlobalEnv, 14: inherits = FALSE) 15: } else { 16: .GlobalEnv$.Random.seed <- oseed 17: } 18: }, add = TRUE) 19: set.seed(seed) 20: } 21: .seed <- .Random.seed 22: if (what == "future") { 23: fs <- list() 24: for (ii in seq_len(size)) { 25: .seed <- parallel::nextRNGStream(.seed) 26: fs[[ii]] <- future({ 27: sample(x, size = 1L) 28: }, lazy = lazy, seed = .seed) 29: } 30: res <- value(fs) 31: } 32: else { 33: res <- listenv::listenv() 34: for (ii in seq_len(size)) { 35: .seed <- parallel::nextRNGStream(.seed) 36: res[[ii]] %<-% { 37: sample(x, size = 1L) 38: } %lazy% lazy %seed% .seed 39: } 40: res <- as.list(res) 41: } 42: res 43: } 44: dummy <- sample(0:3, size = 1L) 45: seed0 <- .Random.seed 46: y0 <- local({ 47: print(unclass(plan)) 48: utils::str(plan) 49: old_plan <- plan() 50: plan("sequential") 51: on.exit(plan(old_plan)) 52: fsample(0:3, seed = 42L) 53: }) 54: stopifnot(identical(.GlobalEnv$.Random.seed, seed0)) 55: .GlobalEnv$.Random.seed <- seed0 56: y1 <- fsample(0:3, seed = 42L, what = "future", lazy = lazy) 57: print(y1) 58: stopifnot(identical(y1, y0)) 59: stopifnot(identical(.GlobalEnv$.Random.seed, seed0)) 60: y2 <- fsample(0:3, seed = 42L, what = "future", lazy = lazy) 61: print(y2) 62: stopifnot(identical(y2, y1)) 63: stopifnot(identical(y2, y0)) 64: stopifnot(identical(.GlobalEnv$.Random.seed, seed0)) 65: y3 <- fsample(0:3, what = "future", lazy = lazy) 66: print(y3) 67: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: list(0L, 2L) - Visible: FALSE - Captured output: 1: 'function (strategy = NULL, ..., substitute = TRUE, .skip = FALSE, ' 2: ' .call = TRUE, .cleanup = TRUE, .init = TRUE) ' 3: '{' 4: ' if (substitute) ' 5: ' strategy <- substitute(strategy)' 6: ' if (is.logical(.skip)) ' 7: ' stop_if_not(length(.skip) == 1L, !is.na(.skip))' 8: ' if (is.logical(.call)) ' 9: ' stop_if_not(length(.call) == 1L, !is.na(.call))' 10: ' if (is.null(strategy) || identical(strategy, "next")) {' 11: ' strategy <- stack[[1L]]' 12: ' if (!inherits(strategy, "FutureStrategy")) {' 13: ' class(strategy) <- c("FutureStrategy", class(strategy))' 14: ' }' 15: ' stop_if_not(is.function(strategy))' 16: ' return(strategy)' 17: ' }' 18: ' else if (identical(strategy, "default")) {' 19: ' strategy <- getOption("future.plan", sequential)' 20: ' }' 21: ' else if (identical(strategy, "list")) {' 22: ' return(stack)' 23: ' }' 24: ' else if (identical(strategy, "reset")) {' 25: ' if (.cleanup) ' 26: ' plan_cleanup()' 27: ' stack <<- defaultStack' 28: ' return(stack)' 29: ' }' 30: ' else if (identical(strategy, "pop")) {' 31: ' oldStack <- stack' 32: ' stack <<- stack[-1L]' 33: ' if (length(stack) == 0L) ' 34: ' stack <<- defaultStack' 35: ' return(oldStack)' 36: ' }' 37: ' oldStack <- stack' 38: ' newStack <- NULL' 39: ' targs <- list(...)' 40: ' if (is.function(strategy)) {' 41: ' if (length(targs) > 0) {' 42: ' args <- c(list(strategy), targs, penvir = parent.frame())' 43: ' strategy <- do.call(tweak, args = args)' 44: ' }' 45: ' strategy <- list(strategy)' 46: ' }' 47: ' if (is.list(strategy)) {' 48: ' oldStack <- plan_set(strategy, skip = .skip, cleanup = .cleanup, ' 49: ' init = .init)' 50: ' return(invisible(oldStack))' 51: ' }' 52: ' if (is.language(strategy)) {' 53: ' first <- as.list(strategy)[[1]]' 54: ' if (is.symbol(first)) {' 55: ' if (is.call(strategy)) {' 56: ' first <- get(as.character(first), mode = "function", ' 57: ' envir = parent.frame(), inherits = TRUE)' 58: ' }' 59: ' else {' 60: ' first <- eval(first, envir = parent.frame(), ' 61: ' enclos = baseenv())' 62: ' }' 63: ' if (is.list(first)) {' 64: ' strategies <- first' 65: ' res <- plan(strategies, substitute = FALSE, .cleanup = .cleanup, ' 66: ' .init = .init)' 67: ' return(invisible(res))' 68: ' }' 69: ' if (is.function(first) && !inherits(first, "future")) {' 70: ' strategies <- eval(strategy, envir = parent.frame(), ' 71: ' enclos = baseenv())' 72: ' if (is.list(strategies)) {' 73: ' for (kk in seq_along(strategies)) {' 74: ' strategy_kk <- strategies[[kk]]' 75: ' if (is.character(strategy_kk)) {' 76: ' strategy_kk <- tweak(strategy_kk, penvir = parent.frame())' 77: ' strategies[[kk]] <- strategy_kk' 78: ' }' 79: ' }' 80: ' newStack <- strategies' 81: ' stop_if_not(!is.null(newStack), is.list(newStack), ' 82: ' length(newStack) >= 1L)' 83: ' }' 84: ' else if (is.function(strategies) && !inherits(strategies, ' 85: ' "future")) {' 86: ' strategies <- list(strategies)' 87: ' newStack <- strategies' 88: ' stop_if_not(!is.null(newStack), is.list(newStack), ' 89: ' length(newStack) >= 1L)' 90: ' }' 91: ' }' 92: ' }' 93: ' }' 94: ' if (is.null(newStack)) {' 95: ' if (is.symbol(strategy)) {' 96: ' strategy <- eval(strategy, envir = parent.frame(), ' 97: ' enclos = baseenv())' 98: ' }' 99: ' else if (is.language(strategy)) {' 100: ' strategyT <- as.list(strategy)' 101: ' if (strategyT[[1]] == as.symbol("tweak")) {' 102: ' strategy <- eval(strategy, envir = parent.frame(), ' 103: ' enclos = baseenv())' 104: ' }' 105: ' else {' 106: ' isSymbol <- sapply(strategyT, FUN = is.symbol)' 107: ' if (!all(isSymbol)) {' 108: ' strategy <- eval(strategyT[[1L]], envir = parent.frame(), ' 109: ' enclos = baseenv())' 110: ' if (length(strategyT) > 1L) {' 111: ' args <- c(list(strategy), strategyT[-1L], ' 112: ' penvir = parent.frame())' 113: ' strategy <- do.call(tweak, args = args)' 114: ' }' 115: ' }' 116: ' else {' 117: ' strategy <- eval(strategy, envir = parent.frame(), ' 118: ' enclos = baseenv())' 119: ' }' 120: ' }' 121: ' }' 122: ' args <- c(list(strategy), targs, penvir = parent.frame())' 123: ' tstrategy <- do.call(tweak, args = args, quote = TRUE)' 124: ' newStack <- list(tstrategy)' 125: ' stop_if_not(!is.null(newStack), is.list(newStack), length(newStack) >= ' 126: ' 1L)' 127: ' }' 128: ' if (!is.null(.call)) {' 129: ' call <- if (isTRUE(.call)) ' 130: ' sys.call()' 131: ' else .call' 132: ' for (kk in seq_along(newStack)) {' 133: ' strategy <- newStack[[kk]]' 134: ' if (!is.null(attr(strategy, "call", exact = TRUE))) ' 135: ' next' 136: ' attr(strategy, "call") <- call' 137: ' newStack[[kk]] <- strategy' 138: ' }' 139: ' stop_if_not(!is.null(newStack), is.list(newStack), length(newStack) >= ' 140: ' 1L)' 141: ' }' 142: ' oldStack <- plan_set(newStack, skip = .skip, cleanup = .cleanup, ' 143: ' init = .init)' 144: ' invisible(oldStack)' 145: '}' 146: '' 147: '' 148: 'function (strategy = NULL, ..., substitute = TRUE, .skip = FALSE, .call = TRUE, ' 149: ' .cleanup = TRUE, .init = TRUE) ' 150: '[[1]]' 151: '[1] 2' 152: '' 153: '[[2]]' 154: '[1] 0' 155: '' 156: '[[1]]' 157: '[1] 2' 158: '' 159: '[[2]]' 160: '[1] 0' 161: '' 162: '[[1]]' 163: '[1] 0' 164: '' 165: '[[2]]' 166: '[1] 2' 167: '' - Success: TRUE - Processing time: 0.090 secs [[1]][[47]][[2]] TestResult: - Test: - Title: 'Random Number Generation (RNG) - future' - Tags: 'rng', 'seed', 'lazy', 'future' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: fsample <- function (x, size = 2L, seed = NULL, what = c("future", 3: "%<-%"), lazy = FALSE) 4: { 5: what <- match.arg(what) 6: .GlobalEnv <- globalenv() 7: oseed <- .GlobalEnv$.Random.seed 8: orng <- RNGkind("L'Ecuyer-CMRG")[1L] 9: on.exit(RNGkind(orng)) 10: if (!is.null(seed)) { 11: on.exit({ 12: if (is.null(oseed)) { 13: rm(list = ".Random.seed", envir = .GlobalEnv, 14: inherits = FALSE) 15: } else { 16: .GlobalEnv$.Random.seed <- oseed 17: } 18: }, add = TRUE) 19: set.seed(seed) 20: } 21: .seed <- .Random.seed 22: if (what == "future") { 23: fs <- list() 24: for (ii in seq_len(size)) { 25: .seed <- parallel::nextRNGStream(.seed) 26: fs[[ii]] <- future({ 27: sample(x, size = 1L) 28: }, lazy = lazy, seed = .seed) 29: } 30: res <- value(fs) 31: } 32: else { 33: res <- listenv::listenv() 34: for (ii in seq_len(size)) { 35: .seed <- parallel::nextRNGStream(.seed) 36: res[[ii]] %<-% { 37: sample(x, size = 1L) 38: } %lazy% lazy %seed% .seed 39: } 40: res <- as.list(res) 41: } 42: res 43: } 44: dummy <- sample(0:3, size = 1L) 45: seed0 <- .Random.seed 46: y0 <- local({ 47: print(unclass(plan)) 48: utils::str(plan) 49: old_plan <- plan() 50: plan("sequential") 51: on.exit(plan(old_plan)) 52: fsample(0:3, seed = 42L) 53: }) 54: stopifnot(identical(.GlobalEnv$.Random.seed, seed0)) 55: .GlobalEnv$.Random.seed <- seed0 56: y1 <- fsample(0:3, seed = 42L, what = "future", lazy = lazy) 57: print(y1) 58: stopifnot(identical(y1, y0)) 59: stopifnot(identical(.GlobalEnv$.Random.seed, seed0)) 60: y2 <- fsample(0:3, seed = 42L, what = "future", lazy = lazy) 61: print(y2) 62: stopifnot(identical(y2, y1)) 63: stopifnot(identical(y2, y0)) 64: stopifnot(identical(.GlobalEnv$.Random.seed, seed0)) 65: y3 <- fsample(0:3, what = "future", lazy = lazy) 66: print(y3) 67: } - Arguments tested: 1. lazy: TRUE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: list(1L, 2L) - Visible: FALSE - Captured output: 1: 'function (strategy = NULL, ..., substitute = TRUE, .skip = FALSE, ' 2: ' .call = TRUE, .cleanup = TRUE, .init = TRUE) ' 3: '{' 4: ' if (substitute) ' 5: ' strategy <- substitute(strategy)' 6: ' if (is.logical(.skip)) ' 7: ' stop_if_not(length(.skip) == 1L, !is.na(.skip))' 8: ' if (is.logical(.call)) ' 9: ' stop_if_not(length(.call) == 1L, !is.na(.call))' 10: ' if (is.null(strategy) || identical(strategy, "next")) {' 11: ' strategy <- stack[[1L]]' 12: ' if (!inherits(strategy, "FutureStrategy")) {' 13: ' class(strategy) <- c("FutureStrategy", class(strategy))' 14: ' }' 15: ' stop_if_not(is.function(strategy))' 16: ' return(strategy)' 17: ' }' 18: ' else if (identical(strategy, "default")) {' 19: ' strategy <- getOption("future.plan", sequential)' 20: ' }' 21: ' else if (identical(strategy, "list")) {' 22: ' return(stack)' 23: ' }' 24: ' else if (identical(strategy, "reset")) {' 25: ' if (.cleanup) ' 26: ' plan_cleanup()' 27: ' stack <<- defaultStack' 28: ' return(stack)' 29: ' }' 30: ' else if (identical(strategy, "pop")) {' 31: ' oldStack <- stack' 32: ' stack <<- stack[-1L]' 33: ' if (length(stack) == 0L) ' 34: ' stack <<- defaultStack' 35: ' return(oldStack)' 36: ' }' 37: ' oldStack <- stack' 38: ' newStack <- NULL' 39: ' targs <- list(...)' 40: ' if (is.function(strategy)) {' 41: ' if (length(targs) > 0) {' 42: ' args <- c(list(strategy), targs, penvir = parent.frame())' 43: ' strategy <- do.call(tweak, args = args)' 44: ' }' 45: ' strategy <- list(strategy)' 46: ' }' 47: ' if (is.list(strategy)) {' 48: ' oldStack <- plan_set(strategy, skip = .skip, cleanup = .cleanup, ' 49: ' init = .init)' 50: ' return(invisible(oldStack))' 51: ' }' 52: ' if (is.language(strategy)) {' 53: ' first <- as.list(strategy)[[1]]' 54: ' if (is.symbol(first)) {' 55: ' if (is.call(strategy)) {' 56: ' first <- get(as.character(first), mode = "function", ' 57: ' envir = parent.frame(), inherits = TRUE)' 58: ' }' 59: ' else {' 60: ' first <- eval(first, envir = parent.frame(), ' 61: ' enclos = baseenv())' 62: ' }' 63: ' if (is.list(first)) {' 64: ' strategies <- first' 65: ' res <- plan(strategies, substitute = FALSE, .cleanup = .cleanup, ' 66: ' .init = .init)' 67: ' return(invisible(res))' 68: ' }' 69: ' if (is.function(first) && !inherits(first, "future")) {' 70: ' strategies <- eval(strategy, envir = parent.frame(), ' 71: ' enclos = baseenv())' 72: ' if (is.list(strategies)) {' 73: ' for (kk in seq_along(strategies)) {' 74: ' strategy_kk <- strategies[[kk]]' 75: ' if (is.character(strategy_kk)) {' 76: ' strategy_kk <- tweak(strategy_kk, penvir = parent.frame())' 77: ' strategies[[kk]] <- strategy_kk' 78: ' }' 79: ' }' 80: ' newStack <- strategies' 81: ' stop_if_not(!is.null(newStack), is.list(newStack), ' 82: ' length(newStack) >= 1L)' 83: ' }' 84: ' else if (is.function(strategies) && !inherits(strategies, ' 85: ' "future")) {' 86: ' strategies <- list(strategies)' 87: ' newStack <- strategies' 88: ' stop_if_not(!is.null(newStack), is.list(newStack), ' 89: ' length(newStack) >= 1L)' 90: ' }' 91: ' }' 92: ' }' 93: ' }' 94: ' if (is.null(newStack)) {' 95: ' if (is.symbol(strategy)) {' 96: ' strategy <- eval(strategy, envir = parent.frame(), ' 97: ' enclos = baseenv())' 98: ' }' 99: ' else if (is.language(strategy)) {' 100: ' strategyT <- as.list(strategy)' 101: ' if (strategyT[[1]] == as.symbol("tweak")) {' 102: ' strategy <- eval(strategy, envir = parent.frame(), ' 103: ' enclos = baseenv())' 104: ' }' 105: ' else {' 106: ' isSymbol <- sapply(strategyT, FUN = is.symbol)' 107: ' if (!all(isSymbol)) {' 108: ' strategy <- eval(strategyT[[1L]], envir = parent.frame(), ' 109: ' enclos = baseenv())' 110: ' if (length(strategyT) > 1L) {' 111: ' args <- c(list(strategy), strategyT[-1L], ' 112: ' penvir = parent.frame())' 113: ' strategy <- do.call(tweak, args = args)' 114: ' }' 115: ' }' 116: ' else {' 117: ' strategy <- eval(strategy, envir = parent.frame(), ' 118: ' enclos = baseenv())' 119: ' }' 120: ' }' 121: ' }' 122: ' args <- c(list(strategy), targs, penvir = parent.frame())' 123: ' tstrategy <- do.call(tweak, args = args, quote = TRUE)' 124: ' newStack <- list(tstrategy)' 125: ' stop_if_not(!is.null(newStack), is.list(newStack), length(newStack) >= ' 126: ' 1L)' 127: ' }' 128: ' if (!is.null(.call)) {' 129: ' call <- if (isTRUE(.call)) ' 130: ' sys.call()' 131: ' else .call' 132: ' for (kk in seq_along(newStack)) {' 133: ' strategy <- newStack[[kk]]' 134: ' if (!is.null(attr(strategy, "call", exact = TRUE))) ' 135: ' next' 136: ' attr(strategy, "call") <- call' 137: ' newStack[[kk]] <- strategy' 138: ' }' 139: ' stop_if_not(!is.null(newStack), is.list(newStack), length(newStack) >= ' 140: ' 1L)' 141: ' }' 142: ' oldStack <- plan_set(newStack, skip = .skip, cleanup = .cleanup, ' 143: ' init = .init)' 144: ' invisible(oldStack)' 145: '}' 146: '' 147: '' 148: 'function (strategy = NULL, ..., substitute = TRUE, .skip = FALSE, .call = TRUE, ' 149: ' .cleanup = TRUE, .init = TRUE) ' 150: '[[1]]' 151: '[1] 2' 152: '' 153: '[[2]]' 154: '[1] 0' 155: '' 156: '[[1]]' 157: '[1] 2' 158: '' 159: '[[2]]' 160: '[1] 0' 161: '' 162: '[[1]]' 163: '[1] 1' 164: '' 165: '[[2]]' 166: '[1] 2' 167: '' - Success: TRUE - Processing time: 0.061 secs [[1]][[48]] [[1]][[48]][[1]] TestResult: - Test: - Title: 'Random Number Generation (RNG) - %<-%' - Tags: 'rng', 'seed', 'lazy', '%<-%' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: fsample <- function (x, size = 2L, seed = NULL, what = c("future", 3: "%<-%"), lazy = FALSE) 4: { 5: what <- match.arg(what) 6: .GlobalEnv <- globalenv() 7: oseed <- .GlobalEnv$.Random.seed 8: orng <- RNGkind("L'Ecuyer-CMRG")[1L] 9: on.exit(RNGkind(orng)) 10: if (!is.null(seed)) { 11: on.exit({ 12: if (is.null(oseed)) { 13: rm(list = ".Random.seed", envir = .GlobalEnv, 14: inherits = FALSE) 15: } else { 16: .GlobalEnv$.Random.seed <- oseed 17: } 18: }, add = TRUE) 19: set.seed(seed) 20: } 21: .seed <- .Random.seed 22: if (what == "future") { 23: fs <- list() 24: for (ii in seq_len(size)) { 25: .seed <- parallel::nextRNGStream(.seed) 26: fs[[ii]] <- future({ 27: sample(x, size = 1L) 28: }, lazy = lazy, seed = .seed) 29: } 30: res <- value(fs) 31: } 32: else { 33: res <- listenv::listenv() 34: for (ii in seq_len(size)) { 35: .seed <- parallel::nextRNGStream(.seed) 36: res[[ii]] %<-% { 37: sample(x, size = 1L) 38: } %lazy% lazy %seed% .seed 39: } 40: res <- as.list(res) 41: } 42: res 43: } 44: dummy <- sample(0:3, size = 1L) 45: seed0 <- .Random.seed 46: y0 <- local({ 47: print(unclass(plan)) 48: utils::str(plan) 49: old_plan <- plan() 50: plan("sequential") 51: on.exit(plan(old_plan)) 52: fsample(0:3, seed = 42L) 53: }) 54: stopifnot(identical(.GlobalEnv$.Random.seed, seed0)) 55: .GlobalEnv$.Random.seed <- seed0 56: y1 <- fsample(0:3, seed = 42L, what = "%<-%", lazy = lazy) 57: print(y1) 58: stopifnot(identical(y1, y0)) 59: stopifnot(identical(.GlobalEnv$.Random.seed, seed0)) 60: y2 <- fsample(0:3, seed = 42L, what = "%<-%", lazy = lazy) 61: print(y2) 62: stopifnot(identical(y2, y1)) 63: stopifnot(identical(y2, y0)) 64: stopifnot(identical(.GlobalEnv$.Random.seed, seed0)) 65: y3 <- fsample(0:3, what = "%<-%", lazy = lazy) 66: print(y3) 67: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: list(0L, 1L) - Visible: FALSE - Captured output: 1: 'function (strategy = NULL, ..., substitute = TRUE, .skip = FALSE, ' 2: ' .call = TRUE, .cleanup = TRUE, .init = TRUE) ' 3: '{' 4: ' if (substitute) ' 5: ' strategy <- substitute(strategy)' 6: ' if (is.logical(.skip)) ' 7: ' stop_if_not(length(.skip) == 1L, !is.na(.skip))' 8: ' if (is.logical(.call)) ' 9: ' stop_if_not(length(.call) == 1L, !is.na(.call))' 10: ' if (is.null(strategy) || identical(strategy, "next")) {' 11: ' strategy <- stack[[1L]]' 12: ' if (!inherits(strategy, "FutureStrategy")) {' 13: ' class(strategy) <- c("FutureStrategy", class(strategy))' 14: ' }' 15: ' stop_if_not(is.function(strategy))' 16: ' return(strategy)' 17: ' }' 18: ' else if (identical(strategy, "default")) {' 19: ' strategy <- getOption("future.plan", sequential)' 20: ' }' 21: ' else if (identical(strategy, "list")) {' 22: ' return(stack)' 23: ' }' 24: ' else if (identical(strategy, "reset")) {' 25: ' if (.cleanup) ' 26: ' plan_cleanup()' 27: ' stack <<- defaultStack' 28: ' return(stack)' 29: ' }' 30: ' else if (identical(strategy, "pop")) {' 31: ' oldStack <- stack' 32: ' stack <<- stack[-1L]' 33: ' if (length(stack) == 0L) ' 34: ' stack <<- defaultStack' 35: ' return(oldStack)' 36: ' }' 37: ' oldStack <- stack' 38: ' newStack <- NULL' 39: ' targs <- list(...)' 40: ' if (is.function(strategy)) {' 41: ' if (length(targs) > 0) {' 42: ' args <- c(list(strategy), targs, penvir = parent.frame())' 43: ' strategy <- do.call(tweak, args = args)' 44: ' }' 45: ' strategy <- list(strategy)' 46: ' }' 47: ' if (is.list(strategy)) {' 48: ' oldStack <- plan_set(strategy, skip = .skip, cleanup = .cleanup, ' 49: ' init = .init)' 50: ' return(invisible(oldStack))' 51: ' }' 52: ' if (is.language(strategy)) {' 53: ' first <- as.list(strategy)[[1]]' 54: ' if (is.symbol(first)) {' 55: ' if (is.call(strategy)) {' 56: ' first <- get(as.character(first), mode = "function", ' 57: ' envir = parent.frame(), inherits = TRUE)' 58: ' }' 59: ' else {' 60: ' first <- eval(first, envir = parent.frame(), ' 61: ' enclos = baseenv())' 62: ' }' 63: ' if (is.list(first)) {' 64: ' strategies <- first' 65: ' res <- plan(strategies, substitute = FALSE, .cleanup = .cleanup, ' 66: ' .init = .init)' 67: ' return(invisible(res))' 68: ' }' 69: ' if (is.function(first) && !inherits(first, "future")) {' 70: ' strategies <- eval(strategy, envir = parent.frame(), ' 71: ' enclos = baseenv())' 72: ' if (is.list(strategies)) {' 73: ' for (kk in seq_along(strategies)) {' 74: ' strategy_kk <- strategies[[kk]]' 75: ' if (is.character(strategy_kk)) {' 76: ' strategy_kk <- tweak(strategy_kk, penvir = parent.frame())' 77: ' strategies[[kk]] <- strategy_kk' 78: ' }' 79: ' }' 80: ' newStack <- strategies' 81: ' stop_if_not(!is.null(newStack), is.list(newStack), ' 82: ' length(newStack) >= 1L)' 83: ' }' 84: ' else if (is.function(strategies) && !inherits(strategies, ' 85: ' "future")) {' 86: ' strategies <- list(strategies)' 87: ' newStack <- strategies' 88: ' stop_if_not(!is.null(newStack), is.list(newStack), ' 89: ' length(newStack) >= 1L)' 90: ' }' 91: ' }' 92: ' }' 93: ' }' 94: ' if (is.null(newStack)) {' 95: ' if (is.symbol(strategy)) {' 96: ' strategy <- eval(strategy, envir = parent.frame(), ' 97: ' enclos = baseenv())' 98: ' }' 99: ' else if (is.language(strategy)) {' 100: ' strategyT <- as.list(strategy)' 101: ' if (strategyT[[1]] == as.symbol("tweak")) {' 102: ' strategy <- eval(strategy, envir = parent.frame(), ' 103: ' enclos = baseenv())' 104: ' }' 105: ' else {' 106: ' isSymbol <- sapply(strategyT, FUN = is.symbol)' 107: ' if (!all(isSymbol)) {' 108: ' strategy <- eval(strategyT[[1L]], envir = parent.frame(), ' 109: ' enclos = baseenv())' 110: ' if (length(strategyT) > 1L) {' 111: ' args <- c(list(strategy), strategyT[-1L], ' 112: ' penvir = parent.frame())' 113: ' strategy <- do.call(tweak, args = args)' 114: ' }' 115: ' }' 116: ' else {' 117: ' strategy <- eval(strategy, envir = parent.frame(), ' 118: ' enclos = baseenv())' 119: ' }' 120: ' }' 121: ' }' 122: ' args <- c(list(strategy), targs, penvir = parent.frame())' 123: ' tstrategy <- do.call(tweak, args = args, quote = TRUE)' 124: ' newStack <- list(tstrategy)' 125: ' stop_if_not(!is.null(newStack), is.list(newStack), length(newStack) >= ' 126: ' 1L)' 127: ' }' 128: ' if (!is.null(.call)) {' 129: ' call <- if (isTRUE(.call)) ' 130: ' sys.call()' 131: ' else .call' 132: ' for (kk in seq_along(newStack)) {' 133: ' strategy <- newStack[[kk]]' 134: ' if (!is.null(attr(strategy, "call", exact = TRUE))) ' 135: ' next' 136: ' attr(strategy, "call") <- call' 137: ' newStack[[kk]] <- strategy' 138: ' }' 139: ' stop_if_not(!is.null(newStack), is.list(newStack), length(newStack) >= ' 140: ' 1L)' 141: ' }' 142: ' oldStack <- plan_set(newStack, skip = .skip, cleanup = .cleanup, ' 143: ' init = .init)' 144: ' invisible(oldStack)' 145: '}' 146: '' 147: '' 148: 'function (strategy = NULL, ..., substitute = TRUE, .skip = FALSE, .call = TRUE, ' 149: ' .cleanup = TRUE, .init = TRUE) ' 150: '[[1]]' 151: '[1] 2' 152: '' 153: '[[2]]' 154: '[1] 0' 155: '' 156: '[[1]]' 157: '[1] 2' 158: '' 159: '[[2]]' 160: '[1] 0' 161: '' 162: '[[1]]' 163: '[1] 0' 164: '' 165: '[[2]]' 166: '[1] 1' 167: '' - Success: TRUE - Processing time: 0.067 secs [[1]][[48]][[2]] TestResult: - Test: - Title: 'Random Number Generation (RNG) - %<-%' - Tags: 'rng', 'seed', 'lazy', '%<-%' - Reset workers: FALSE - Arguments: 1. lazy: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: fsample <- function (x, size = 2L, seed = NULL, what = c("future", 3: "%<-%"), lazy = FALSE) 4: { 5: what <- match.arg(what) 6: .GlobalEnv <- globalenv() 7: oseed <- .GlobalEnv$.Random.seed 8: orng <- RNGkind("L'Ecuyer-CMRG")[1L] 9: on.exit(RNGkind(orng)) 10: if (!is.null(seed)) { 11: on.exit({ 12: if (is.null(oseed)) { 13: rm(list = ".Random.seed", envir = .GlobalEnv, 14: inherits = FALSE) 15: } else { 16: .GlobalEnv$.Random.seed <- oseed 17: } 18: }, add = TRUE) 19: set.seed(seed) 20: } 21: .seed <- .Random.seed 22: if (what == "future") { 23: fs <- list() 24: for (ii in seq_len(size)) { 25: .seed <- parallel::nextRNGStream(.seed) 26: fs[[ii]] <- future({ 27: sample(x, size = 1L) 28: }, lazy = lazy, seed = .seed) 29: } 30: res <- value(fs) 31: } 32: else { 33: res <- listenv::listenv() 34: for (ii in seq_len(size)) { 35: .seed <- parallel::nextRNGStream(.seed) 36: res[[ii]] %<-% { 37: sample(x, size = 1L) 38: } %lazy% lazy %seed% .seed 39: } 40: res <- as.list(res) 41: } 42: res 43: } 44: dummy <- sample(0:3, size = 1L) 45: seed0 <- .Random.seed 46: y0 <- local({ 47: print(unclass(plan)) 48: utils::str(plan) 49: old_plan <- plan() 50: plan("sequential") 51: on.exit(plan(old_plan)) 52: fsample(0:3, seed = 42L) 53: }) 54: stopifnot(identical(.GlobalEnv$.Random.seed, seed0)) 55: .GlobalEnv$.Random.seed <- seed0 56: y1 <- fsample(0:3, seed = 42L, what = "%<-%", lazy = lazy) 57: print(y1) 58: stopifnot(identical(y1, y0)) 59: stopifnot(identical(.GlobalEnv$.Random.seed, seed0)) 60: y2 <- fsample(0:3, seed = 42L, what = "%<-%", lazy = lazy) 61: print(y2) 62: stopifnot(identical(y2, y1)) 63: stopifnot(identical(y2, y0)) 64: stopifnot(identical(.GlobalEnv$.Random.seed, seed0)) 65: y3 <- fsample(0:3, what = "%<-%", lazy = lazy) 66: print(y3) 67: } - Arguments tested: 1. lazy: TRUE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: list(0L, 0L) - Visible: FALSE - Captured output: 1: 'function (strategy = NULL, ..., substitute = TRUE, .skip = FALSE, ' 2: ' .call = TRUE, .cleanup = TRUE, .init = TRUE) ' 3: '{' 4: ' if (substitute) ' 5: ' strategy <- substitute(strategy)' 6: ' if (is.logical(.skip)) ' 7: ' stop_if_not(length(.skip) == 1L, !is.na(.skip))' 8: ' if (is.logical(.call)) ' 9: ' stop_if_not(length(.call) == 1L, !is.na(.call))' 10: ' if (is.null(strategy) || identical(strategy, "next")) {' 11: ' strategy <- stack[[1L]]' 12: ' if (!inherits(strategy, "FutureStrategy")) {' 13: ' class(strategy) <- c("FutureStrategy", class(strategy))' 14: ' }' 15: ' stop_if_not(is.function(strategy))' 16: ' return(strategy)' 17: ' }' 18: ' else if (identical(strategy, "default")) {' 19: ' strategy <- getOption("future.plan", sequential)' 20: ' }' 21: ' else if (identical(strategy, "list")) {' 22: ' return(stack)' 23: ' }' 24: ' else if (identical(strategy, "reset")) {' 25: ' if (.cleanup) ' 26: ' plan_cleanup()' 27: ' stack <<- defaultStack' 28: ' return(stack)' 29: ' }' 30: ' else if (identical(strategy, "pop")) {' 31: ' oldStack <- stack' 32: ' stack <<- stack[-1L]' 33: ' if (length(stack) == 0L) ' 34: ' stack <<- defaultStack' 35: ' return(oldStack)' 36: ' }' 37: ' oldStack <- stack' 38: ' newStack <- NULL' 39: ' targs <- list(...)' 40: ' if (is.function(strategy)) {' 41: ' if (length(targs) > 0) {' 42: ' args <- c(list(strategy), targs, penvir = parent.frame())' 43: ' strategy <- do.call(tweak, args = args)' 44: ' }' 45: ' strategy <- list(strategy)' 46: ' }' 47: ' if (is.list(strategy)) {' 48: ' oldStack <- plan_set(strategy, skip = .skip, cleanup = .cleanup, ' 49: ' init = .init)' 50: ' return(invisible(oldStack))' 51: ' }' 52: ' if (is.language(strategy)) {' 53: ' first <- as.list(strategy)[[1]]' 54: ' if (is.symbol(first)) {' 55: ' if (is.call(strategy)) {' 56: ' first <- get(as.character(first), mode = "function", ' 57: ' envir = parent.frame(), inherits = TRUE)' 58: ' }' 59: ' else {' 60: ' first <- eval(first, envir = parent.frame(), ' 61: ' enclos = baseenv())' 62: ' }' 63: ' if (is.list(first)) {' 64: ' strategies <- first' 65: ' res <- plan(strategies, substitute = FALSE, .cleanup = .cleanup, ' 66: ' .init = .init)' 67: ' return(invisible(res))' 68: ' }' 69: ' if (is.function(first) && !inherits(first, "future")) {' 70: ' strategies <- eval(strategy, envir = parent.frame(), ' 71: ' enclos = baseenv())' 72: ' if (is.list(strategies)) {' 73: ' for (kk in seq_along(strategies)) {' 74: ' strategy_kk <- strategies[[kk]]' 75: ' if (is.character(strategy_kk)) {' 76: ' strategy_kk <- tweak(strategy_kk, penvir = parent.frame())' 77: ' strategies[[kk]] <- strategy_kk' 78: ' }' 79: ' }' 80: ' newStack <- strategies' 81: ' stop_if_not(!is.null(newStack), is.list(newStack), ' 82: ' length(newStack) >= 1L)' 83: ' }' 84: ' else if (is.function(strategies) && !inherits(strategies, ' 85: ' "future")) {' 86: ' strategies <- list(strategies)' 87: ' newStack <- strategies' 88: ' stop_if_not(!is.null(newStack), is.list(newStack), ' 89: ' length(newStack) >= 1L)' 90: ' }' 91: ' }' 92: ' }' 93: ' }' 94: ' if (is.null(newStack)) {' 95: ' if (is.symbol(strategy)) {' 96: ' strategy <- eval(strategy, envir = parent.frame(), ' 97: ' enclos = baseenv())' 98: ' }' 99: ' else if (is.language(strategy)) {' 100: ' strategyT <- as.list(strategy)' 101: ' if (strategyT[[1]] == as.symbol("tweak")) {' 102: ' strategy <- eval(strategy, envir = parent.frame(), ' 103: ' enclos = baseenv())' 104: ' }' 105: ' else {' 106: ' isSymbol <- sapply(strategyT, FUN = is.symbol)' 107: ' if (!all(isSymbol)) {' 108: ' strategy <- eval(strategyT[[1L]], envir = parent.frame(), ' 109: ' enclos = baseenv())' 110: ' if (length(strategyT) > 1L) {' 111: ' args <- c(list(strategy), strategyT[-1L], ' 112: ' penvir = parent.frame())' 113: ' strategy <- do.call(tweak, args = args)' 114: ' }' 115: ' }' 116: ' else {' 117: ' strategy <- eval(strategy, envir = parent.frame(), ' 118: ' enclos = baseenv())' 119: ' }' 120: ' }' 121: ' }' 122: ' args <- c(list(strategy), targs, penvir = parent.frame())' 123: ' tstrategy <- do.call(tweak, args = args, quote = TRUE)' 124: ' newStack <- list(tstrategy)' 125: ' stop_if_not(!is.null(newStack), is.list(newStack), length(newStack) >= ' 126: ' 1L)' 127: ' }' 128: ' if (!is.null(.call)) {' 129: ' call <- if (isTRUE(.call)) ' 130: ' sys.call()' 131: ' else .call' 132: ' for (kk in seq_along(newStack)) {' 133: ' strategy <- newStack[[kk]]' 134: ' if (!is.null(attr(strategy, "call", exact = TRUE))) ' 135: ' next' 136: ' attr(strategy, "call") <- call' 137: ' newStack[[kk]] <- strategy' 138: ' }' 139: ' stop_if_not(!is.null(newStack), is.list(newStack), length(newStack) >= ' 140: ' 1L)' 141: ' }' 142: ' oldStack <- plan_set(newStack, skip = .skip, cleanup = .cleanup, ' 143: ' init = .init)' 144: ' invisible(oldStack)' 145: '}' 146: '' 147: '' 148: 'function (strategy = NULL, ..., substitute = TRUE, .skip = FALSE, .call = TRUE, ' 149: ' .cleanup = TRUE, .init = TRUE) ' 150: '[[1]]' 151: '[1] 2' 152: '' 153: '[[2]]' 154: '[1] 0' 155: '' 156: '[[1]]' 157: '[1] 2' 158: '' 159: '[[2]]' 160: '[1] 0' 161: '' 162: '[[1]]' 163: '[1] 0' 164: '' 165: '[[2]]' 166: '[1] 0' 167: '' - Success: TRUE - Processing time: 0.079 secs [[1]][[49]] [[1]][[49]][[1]] TestResult: - Test: - Title: 'Orchestration Stability - future() does not update RNG state' - Tags: 'orchestration', 'rng', 'seed', 'stealth' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: rng0 <- globalenv()$.Random.seed 3: f1 <- future(1) 4: stopifnot(identical(globalenv()$.Random.seed, rng0)) 5: f2 <- future(2) 6: stopifnot(identical(globalenv()$.Random.seed, rng0)) 7: v1 <- value(f1) 8: stopifnot(identical(v1, 1)) 9: v2 <- value(f2) 10: stopifnot(identical(v2, 2)) 11: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.013 secs [[1]][[50]] [[1]][[50]][[1]] TestResult: - Test: - Title: 'Orchestration Stability - run() does not update RNG state' - Tags: 'orchestration', 'rng', 'seed', 'stealth' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: f1 <- future(1, lazy = TRUE) 3: f2 <- future(2, lazy = TRUE) 4: rng0 <- globalenv()$.Random.seed 5: f1 <- run(f1) 6: stopifnot(identical(globalenv()$.Random.seed, rng0)) 7: f2 <- run(f2) 8: stopifnot(identical(globalenv()$.Random.seed, rng0)) 9: v1 <- value(f1) 10: stopifnot(identical(v1, 1)) 11: v2 <- value(f2) 12: stopifnot(identical(v2, 2)) 13: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.010 secs [[1]][[51]] [[1]][[51]][[1]] TestResult: - Test: - Title: 'Orchestration Stability - result() does not update RNG state' - Tags: 'orchestration', 'rng', 'seed', 'stealth' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: f1 <- future(1) 3: f2 <- future(2) 4: rng0 <- globalenv()$.Random.seed 5: r1 <- result(f1) 6: stopifnot(identical(r1$value, 1)) 7: stopifnot(identical(globalenv()$.Random.seed, rng0)) 8: r2 <- result(f2) 9: stopifnot(identical(r2$value, 2)) 10: stopifnot(identical(globalenv()$.Random.seed, rng0)) 11: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.010 secs [[1]][[52]] [[1]][[52]][[1]] TestResult: - Test: - Title: 'Orchestration Stability - value() does not update RNG state' - Tags: 'orchestration', 'rng', 'seed', 'stealth' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: f1 <- future(1) 3: f2 <- future(2) 4: rng0 <- globalenv()$.Random.seed 5: v1 <- value(f1) 6: stopifnot(identical(v1, 1)) 7: stopifnot(identical(globalenv()$.Random.seed, rng0)) 8: v2 <- value(f2) 9: stopifnot(identical(v2, 2)) 10: stopifnot(identical(globalenv()$.Random.seed, rng0)) 11: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.011 secs [[1]][[53]] [[1]][[53]][[1]] TestResult: - Test: - Title: 'future() - standard output' - Tags: 'future', 'stdout' - Reset workers: FALSE - Arguments: 1. stdout: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: truth_rows <- utils::capture.output({ 3: print(1:50) 4: str(1:50) 5: cat(letters, sep = "-") 6: cat(1:6, collapse = "\n") 7: write.table(datasets::iris[1:10, ], sep = "\t") 8: }) 9: truth <- paste0(paste(truth_rows, collapse = "\n"), "\n") 10: print(truth) 11: f <- future({ 12: print(1:50) 13: str(1:50) 14: cat(letters, sep = "-") 15: cat(1:6, collapse = "\n") 16: write.table(datasets::iris[1:10, ], sep = "\t") 17: 42L 18: }, stdout = stdout) 19: r <- result(f) 20: str(r) 21: stopifnot(value(f) == 42L) 22: if (stdout) { 23: print(r) 24: message(sprintf("- stdout = %s", stdout)) 25: stopifnot(identical(r$stdout, truth)) 26: } 27: else { 28: print(r) 29: print(plan()) 30: message(sprintf("- stdout = %s", stdout)) 31: stopifnot(is.null(r$stdout) || r$stdout == "") 32: } 33: } - Arguments tested: 1. stdout: FALSE 2. lazy: FALSE 3. globals: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '[1] " [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25\n[26] 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50\n int [1:50] 1 2 3 4 5 6 7 8 9 10 ...\na-b-c-d-e-f-g-h-i-j-k-l-m-n-o-p-q-r-s-t-u-v-w-x-y-z1 2 3 4 5 6 \n\"Sepal.Length\"\t\"Sepal.Width\"\t\"Petal.Length\"\t\"Petal.Width\"\t\"Species\"\n\"1\"\t5.1\t3.5\t1.4\t0.2\t\"setosa\"\n\"2\"\t4.9\t3\t1.4\t0.2\t\"setosa\"\n\"3\"\t4.7\t3.2\t1.3\t0.2\t\"setosa\"\n\"4\"\t4.6\t3.1\t1.5\t0.2\t\"setosa\"\n\"5\"\t5\t3.6\t1.4\t0.2\t\"setosa\"\n\"6\"\t5.4\t3.9\t1.7\t0.4\t\"setosa\"\n\"7\"\t4.6\t3.4\t1.4\t0.3\t\"setosa\"\n\"8\"\t5\t3.4\t1.5\t0.2\t\"setosa\"\n\"9\"\t4.4\t2.9\t1.4\t0.2\t\"setosa\"\n\"10\"\t4.9\t3.1\t1.5\t0.1\t\"setosa\"\n"' 2: 'List of 11' 3: ' $ value : int 42' 4: ' $ visible : logi TRUE' 5: ' $ stdout : NULL' 6: ' $ conditions : list()' 7: ' $ rng : logi FALSE' 8: ' $ globalenv : NULL' 9: ' $ started : POSIXct[1:1], format: "2025-03-31 07:22:25"' 10: ' $ finished : POSIXct[1:1], format: "2025-03-31 07:22:25"' 11: ' $ session_uuid: chr "06c6277d-6ec9-2e58-f4db-3d8c1a0b16a0"' 12: ' ..- attr(*, "source")=List of 5' 13: ' .. ..$ host : Named chr "CRANWIN3"' 14: ' .. .. ..- attr(*, "names")= chr "COMPUTERNAME"' 15: ' .. ..$ info : Named chr [1:9] "Windows" "Server x64" "build 20348" "CRANWIN3" ...' 16: ' .. .. ..- attr(*, "names")= chr [1:9] "sysname" "release" "version" "nodename" ...' 17: ' .. ..$ pid : int 67716' 18: ' .. ..$ time : POSIXct[1:1], format: "2025-03-31 07:22:11"' 19: ' .. ..$ random: int 2147483647' 20: ' $ r_info :List of 4' 21: ' ..$ version :Classes 'R_system_version', 'package_version', 'numeric_version' hidden list of 1' 22: ' .. ..$ : int [1:3] 4 5 0' 23: ' ..$ os : chr "windows"' 24: ' ..$ os_name : chr "Windows"' 25: ' ..$ captures_utf8: logi TRUE' 26: ' $ version : chr "1.8"' 27: ' - attr(*, "class")= chr "FutureResult"' 28: 'FutureResult:' 29: 'value: 'integer'' 30: 'visible: TRUE' 31: 'stdout: NULL' 32: 'conditions: [n = 0] ' 33: 'RNG used: FALSE' 34: 'duration: 0.004808903 secs (started 2025-03-31 07:22:25.46918)' 35: 'version: 1.8' 36: 'sequential:' 37: '- args: function (..., envir = parent.frame(), workers = "")' 38: '- tweaked: FALSE' 39: '- call: plan(sequential)' - Success: TRUE - Processing time: 0.035 secs [[1]][[53]][[2]] TestResult: - Test: - Title: 'future() - standard output' - Tags: 'future', 'stdout' - Reset workers: FALSE - Arguments: 1. stdout: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: truth_rows <- utils::capture.output({ 3: print(1:50) 4: str(1:50) 5: cat(letters, sep = "-") 6: cat(1:6, collapse = "\n") 7: write.table(datasets::iris[1:10, ], sep = "\t") 8: }) 9: truth <- paste0(paste(truth_rows, collapse = "\n"), "\n") 10: print(truth) 11: f <- future({ 12: print(1:50) 13: str(1:50) 14: cat(letters, sep = "-") 15: cat(1:6, collapse = "\n") 16: write.table(datasets::iris[1:10, ], sep = "\t") 17: 42L 18: }, stdout = stdout) 19: r <- result(f) 20: str(r) 21: stopifnot(value(f) == 42L) 22: if (stdout) { 23: print(r) 24: message(sprintf("- stdout = %s", stdout)) 25: stopifnot(identical(r$stdout, truth)) 26: } 27: else { 28: print(r) 29: print(plan()) 30: message(sprintf("- stdout = %s", stdout)) 31: stopifnot(is.null(r$stdout) || r$stdout == "") 32: } 33: } - Arguments tested: 1. stdout: TRUE 2. lazy: FALSE 3. globals: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '[1] " [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25\n[26] 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50\n int [1:50] 1 2 3 4 5 6 7 8 9 10 ...\na-b-c-d-e-f-g-h-i-j-k-l-m-n-o-p-q-r-s-t-u-v-w-x-y-z1 2 3 4 5 6 \n\"Sepal.Length\"\t\"Sepal.Width\"\t\"Petal.Length\"\t\"Petal.Width\"\t\"Species\"\n\"1\"\t5.1\t3.5\t1.4\t0.2\t\"setosa\"\n\"2\"\t4.9\t3\t1.4\t0.2\t\"setosa\"\n\"3\"\t4.7\t3.2\t1.3\t0.2\t\"setosa\"\n\"4\"\t4.6\t3.1\t1.5\t0.2\t\"setosa\"\n\"5\"\t5\t3.6\t1.4\t0.2\t\"setosa\"\n\"6\"\t5.4\t3.9\t1.7\t0.4\t\"setosa\"\n\"7\"\t4.6\t3.4\t1.4\t0.3\t\"setosa\"\n\"8\"\t5\t3.4\t1.5\t0.2\t\"setosa\"\n\"9\"\t4.4\t2.9\t1.4\t0.2\t\"setosa\"\n\"10\"\t4.9\t3.1\t1.5\t0.1\t\"setosa\"\n"' 2: 'List of 11' 3: ' $ value : int 42' 4: ' $ visible : logi TRUE' 5: ' $ stdout : chr " [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25\n[26] 26 27 28 29 30 31 32 33 3"| __truncated__' 6: ' $ conditions : list()' 7: ' $ rng : logi FALSE' 8: ' $ globalenv : NULL' 9: ' $ started : POSIXct[1:1], format: "2025-03-31 07:22:25"' 10: ' $ finished : POSIXct[1:1], format: "2025-03-31 07:22:25"' 11: ' $ session_uuid: chr "06c6277d-6ec9-2e58-f4db-3d8c1a0b16a0"' 12: ' ..- attr(*, "source")=List of 5' 13: ' .. ..$ host : Named chr "CRANWIN3"' 14: ' .. .. ..- attr(*, "names")= chr "COMPUTERNAME"' 15: ' .. ..$ info : Named chr [1:9] "Windows" "Server x64" "build 20348" "CRANWIN3" ...' 16: ' .. .. ..- attr(*, "names")= chr [1:9] "sysname" "release" "version" "nodename" ...' 17: ' .. ..$ pid : int 67716' 18: ' .. ..$ time : POSIXct[1:1], format: "2025-03-31 07:22:11"' 19: ' .. ..$ random: int 2147483647' 20: ' $ r_info :List of 4' 21: ' ..$ version :Classes 'R_system_version', 'package_version', 'numeric_version' hidden list of 1' 22: ' .. ..$ : int [1:3] 4 5 0' 23: ' ..$ os : chr "windows"' 24: ' ..$ os_name : chr "Windows"' 25: ' ..$ captures_utf8: logi TRUE' 26: ' $ version : chr "1.8"' 27: ' - attr(*, "class")= chr "FutureResult"' 28: ' [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25' 29: '[26] 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50' 30: ' int [1:50] 1 2 3 4 5 6 7 8 9 10 ...' 31: 'a-b-c-d-e-f-g-h-i-j-k-l-m-n-o-p-q-r-s-t-u-v-w-x-y-z1 2 3 4 5 6 ' 32: '"Sepal.Length" "Sepal.Width" "Petal.Length" "Petal.Width" "Species"' 33: '"1" 5.1 3.5 1.4 0.2 "setosa"' 34: '"2" 4.9 3 1.4 0.2 "setosa"' 35: '"3" 4.7 3.2 1.3 0.2 "setosa"' 36: '"4" 4.6 3.1 1.5 0.2 "setosa"' 37: '"5" 5 3.6 1.4 0.2 "setosa"' 38: '"6" 5.4 3.9 1.7 0.4 "setosa"' 39: '"7" 4.6 3.4 1.4 0.3 "setosa"' 40: '"8" 5 3.4 1.5 0.2 "setosa"' 41: '"9" 4.4 2.9 1.4 0.2 "setosa"' 42: '"10" 4.9 3.1 1.5 0.1 "setosa"' 43: 'FutureResult:' 44: 'value: 'integer'' 45: 'visible: TRUE' 46: 'stdout: character' 47: 'conditions: [n = 0] ' 48: 'RNG used: FALSE' 49: 'duration: 0.006127834 secs (started 2025-03-31 07:22:25.52568)' 50: 'version: 1.8' - Success: TRUE - Processing time: 0.048 secs [[1]][[54]] [[1]][[54]][[1]] TestResult: - Test: - Title: '%<-% - standard output' - Tags: '%<-%', 'stdout' - Reset workers: FALSE - Arguments: 1. stdout: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: truth_rows <- utils::capture.output({ 3: print(1:50) 4: str(1:50) 5: cat(letters, sep = "-") 6: cat(1:6, collapse = "\n") 7: write.table(datasets::iris[1:10, ], sep = "\t") 8: }) 9: truth <- paste0(paste(truth_rows, collapse = "\n"), "\n") 10: print(truth) 11: v %<-% { 12: print(1:50) 13: str(1:50) 14: cat(letters, sep = "-") 15: cat(1:6, collapse = "\n") 16: write.table(datasets::iris[1:10, ], sep = "\t") 17: 42L 18: } %stdout% stdout 19: out <- utils::capture.output(y <- v) 20: stopifnot(y == 42L) 21: if (!stdout) { 22: stopifnot(out == "") 23: } 24: else { 25: print(out) 26: stopifnot(identical(out, truth_rows)) 27: } 28: } - Arguments tested: 1. stdout: FALSE 2. lazy: FALSE 3. globals: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '[1] " [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25\n[26] 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50\n int [1:50] 1 2 3 4 5 6 7 8 9 10 ...\na-b-c-d-e-f-g-h-i-j-k-l-m-n-o-p-q-r-s-t-u-v-w-x-y-z1 2 3 4 5 6 \n\"Sepal.Length\"\t\"Sepal.Width\"\t\"Petal.Length\"\t\"Petal.Width\"\t\"Species\"\n\"1\"\t5.1\t3.5\t1.4\t0.2\t\"setosa\"\n\"2\"\t4.9\t3\t1.4\t0.2\t\"setosa\"\n\"3\"\t4.7\t3.2\t1.3\t0.2\t\"setosa\"\n\"4\"\t4.6\t3.1\t1.5\t0.2\t\"setosa\"\n\"5\"\t5\t3.6\t1.4\t0.2\t\"setosa\"\n\"6\"\t5.4\t3.9\t1.7\t0.4\t\"setosa\"\n\"7\"\t4.6\t3.4\t1.4\t0.3\t\"setosa\"\n\"8\"\t5\t3.4\t1.5\t0.2\t\"setosa\"\n\"9\"\t4.4\t2.9\t1.4\t0.2\t\"setosa\"\n\"10\"\t4.9\t3.1\t1.5\t0.1\t\"setosa\"\n"' - Success: TRUE - Processing time: 0.021 secs [[1]][[54]][[2]] TestResult: - Test: - Title: '%<-% - standard output' - Tags: '%<-%', 'stdout' - Reset workers: FALSE - Arguments: 1. stdout: [n = 2] c(FALSE, TRUE) => Test combinations: 2 - Expression: 1: { 2: truth_rows <- utils::capture.output({ 3: print(1:50) 4: str(1:50) 5: cat(letters, sep = "-") 6: cat(1:6, collapse = "\n") 7: write.table(datasets::iris[1:10, ], sep = "\t") 8: }) 9: truth <- paste0(paste(truth_rows, collapse = "\n"), "\n") 10: print(truth) 11: v %<-% { 12: print(1:50) 13: str(1:50) 14: cat(letters, sep = "-") 15: cat(1:6, collapse = "\n") 16: write.table(datasets::iris[1:10, ], sep = "\t") 17: 42L 18: } %stdout% stdout 19: out <- utils::capture.output(y <- v) 20: stopifnot(y == 42L) 21: if (!stdout) { 22: stopifnot(out == "") 23: } 24: else { 25: print(out) 26: stopifnot(identical(out, truth_rows)) 27: } 28: } - Arguments tested: 1. stdout: TRUE 2. lazy: FALSE 3. globals: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '[1] " [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25\n[26] 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50\n int [1:50] 1 2 3 4 5 6 7 8 9 10 ...\na-b-c-d-e-f-g-h-i-j-k-l-m-n-o-p-q-r-s-t-u-v-w-x-y-z1 2 3 4 5 6 \n\"Sepal.Length\"\t\"Sepal.Width\"\t\"Petal.Length\"\t\"Petal.Width\"\t\"Species\"\n\"1\"\t5.1\t3.5\t1.4\t0.2\t\"setosa\"\n\"2\"\t4.9\t3\t1.4\t0.2\t\"setosa\"\n\"3\"\t4.7\t3.2\t1.3\t0.2\t\"setosa\"\n\"4\"\t4.6\t3.1\t1.5\t0.2\t\"setosa\"\n\"5\"\t5\t3.6\t1.4\t0.2\t\"setosa\"\n\"6\"\t5.4\t3.9\t1.7\t0.4\t\"setosa\"\n\"7\"\t4.6\t3.4\t1.4\t0.3\t\"setosa\"\n\"8\"\t5\t3.4\t1.5\t0.2\t\"setosa\"\n\"9\"\t4.4\t2.9\t1.4\t0.2\t\"setosa\"\n\"10\"\t4.9\t3.1\t1.5\t0.1\t\"setosa\"\n"' 2: ' [1] " [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25" ' 3: ' [2] "[26] 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50" ' 4: ' [3] " int [1:50] 1 2 3 4 5 6 7 8 9 10 ..." ' 5: ' [4] "a-b-c-d-e-f-g-h-i-j-k-l-m-n-o-p-q-r-s-t-u-v-w-x-y-z1 2 3 4 5 6 " ' 6: ' [5] "\"Sepal.Length\"\t\"Sepal.Width\"\t\"Petal.Length\"\t\"Petal.Width\"\t\"Species\""' 7: ' [6] "\"1\"\t5.1\t3.5\t1.4\t0.2\t\"setosa\"" ' 8: ' [7] "\"2\"\t4.9\t3\t1.4\t0.2\t\"setosa\"" ' 9: ' [8] "\"3\"\t4.7\t3.2\t1.3\t0.2\t\"setosa\"" ' 10: ' [9] "\"4\"\t4.6\t3.1\t1.5\t0.2\t\"setosa\"" ' 11: '[10] "\"5\"\t5\t3.6\t1.4\t0.2\t\"setosa\"" ' 12: '[11] "\"6\"\t5.4\t3.9\t1.7\t0.4\t\"setosa\"" ' 13: '[12] "\"7\"\t4.6\t3.4\t1.4\t0.3\t\"setosa\"" ' 14: '[13] "\"8\"\t5\t3.4\t1.5\t0.2\t\"setosa\"" ' 15: '[14] "\"9\"\t4.4\t2.9\t1.4\t0.2\t\"setosa\"" ' 16: '[15] "\"10\"\t4.9\t3.1\t1.5\t0.1\t\"setosa\"" ' - Success: TRUE - Processing time: 0.021 secs [[1]][[55]] [[1]][[55]][[1]] TestResult: - Test: - Title: 'value() - visibility' - Tags: 'value', 'visibility' - Reset workers: FALSE - Arguments: => Test combinations: 1 - Expression: 1: { 2: f <- future(42) 3: res <- withVisible({ 4: value(f) 5: }) 6: v <- res$value 7: stopifnot(identical(v, 42)) 8: stopifnot(res$visible) 9: f <- future(invisible(42)) 10: res <- withVisible({ 11: value(f) 12: }) 13: v <- res$value 14: stopifnot(identical(v, 42)) 15: stopifnot(!res$visible) 16: } - Arguments tested: 1. lazy: FALSE 2. globals: TRUE 3. stdout: TRUE - Local evaluation: TRUE - Result: - Value: NULL - Visible: FALSE - Captured output: 1: '' - Success: TRUE - Processing time: 0.014 secs attr(,"plan") sequential: - args: function (..., envir = parent.frame(), workers = "") - tweaked: FALSE - call: plan(sequential) attr(,"exit_code") [1] 0 Total number of errors: 0 > proc.time() user system elapsed 6.29 0.37 15.07 Warning message: In system2("quarto", "-V", stdout = TRUE, env = paste0("TMPDIR=", : running command '"quarto" TMPDIR=D:/temp/2025_03_31_07_20_17_27831/RtmpO0zawY/file1088448274f1a -V' had status 1