R Under development (unstable) (2024-03-25 r86192 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > source("incl/start.R") [17:26:09.609] plan(): Setting new future strategy stack: [17:26:09.611] List of future strategies: [17:26:09.611] 1. sequential: [17:26:09.611] - args: function (..., envir = parent.frame(), workers = "") [17:26:09.611] - tweaked: FALSE [17:26:09.611] - call: future::plan("sequential") [17:26:09.626] plan(): nbrOfWorkers() = 1 > options(future.debug = FALSE) > > message("*** cluster() ...") *** cluster() ... > > message("Library paths: ", paste(sQuote(.libPaths()), collapse = ", ")) Library paths: 'D:/temp/RtmpAVtqMV/RLIBS_30708245f64e7', 'D:/RCompile/recent/R/library' > message("Package path: ", sQuote(system.file(package = "future"))) Package path: 'D:/RCompile/CRANincoming/R-devel/lib/future' > > types <- "PSOCK" > > ## Speed up CRAN checks: Skip on CRAN Windows 32-bit > if (isWin32) types <- NULL > > if (supportsMulticore() && !on_solaris) types <- c(types, "FORK") > > setupClusterWithoutPkgs <- function(type = "PSOCK", withouts = c("future")) { + cl <- parallel::makeCluster(1L, type = type, timeout = 60) + + ## Emulate a worker that does not have 'future' installed. + ## by setting a different user library path on the worker. + libs <- parallel::clusterEvalQ(cl, .libPaths(tempdir()))[[1]] + + ## Check whether 'future' is still available on the worker or not. + ## It could be that it is installed in the system library path, which + ## in case we cannot "hide" the future package from the worker. + has_pkgs <- parallel::clusterCall(cl, fun = sapply, X = withouts, + FUN = requireNamespace)[[1]] + + attr(cl, "libs") <- libs + attr(cl, "has_pkgs") <- has_pkgs + + cl + } > > cl <- NULL > for (type in types) { + message(sprintf("Test set #1 with cluster type %s ...", sQuote(type))) + + cl <- setupClusterWithoutPkgs(type) + if (!all(attr(cl, "has_pkgs"))) { + ## If worker does not have 'future' installed, then there will be an + ## error already when plan() is called, because it will attempt to + ## launch a quick future to validate that everything works. + + res <- tryCatch({ + plan(cluster, workers = cl) + }, error = identity) + print(res) + stopifnot(inherits(res, "FutureError")) + } + parallel::stopCluster(cl) + + cl <- setupClusterWithoutPkgs(type) + if (!all(attr(cl, "has_pkgs"))) { + ## However, if we disable the quick future test, we should not get + ## an error here. + plan(cluster, workers = cl, .skip = FALSE, .init = FALSE) + + ## But we will get: + ## '): '42L'> + ## if we try to resolve a future: + f <- future(42L) + res <- tryCatch({ + result(f) + }, error = identity) + print(res) + stopifnot(inherits(res, "FutureError")) + + ## Assert that the "result" was recorded for future use and + ## it was recorded as a FutureError. + str(f$result) + stopifnot(!is.null(f$result), + inherits(f$result, "FutureError")) + + ## Any attempts to re-request the result / value for this future + ## should from now on re-throw that recorded FutureError. + str(f$result) + stopifnot(!is.null(f$result)) + + ## The main rationale for this is that we don't want result() to + ## wait for ever from retrying to retrieve already retrieved results + ## from worker. + res <- tryCatch({ + result(f) + }, error = identity) + stopifnot(inherits(res, "FutureError")) + + ## ... and obviously the same for value(). + res <- tryCatch({ + value(f) + }, error = identity) + stopifnot(inherits(res, "FutureError")) + + ## Retrying with a new future should give the same failure as above. + f <- future(42L) + res <- tryCatch({ + result(f) + }, error = identity) + print(res) + stopifnot(inherits(res, "FutureError")) + } + + parallel::stopCluster(cl) + cl <- NULL + + plan(sequential) + + message(sprintf("Test set #1 with cluster type %s ... DONE", sQuote(type))) + } ## for (type ...) Test set #1 with cluster type 'PSOCK' ... Future UUID: cf95bd33-0cf2-64b2-2f5b-b5e764120e2b DEBUG: BEGIN TROUBLESHOOTING HELP Future involved: ClusterFuture: Label: 'future-plan-test' Expression: [1] NA Lazy evaluation: FALSE Asynchronous evaluation: TRUE Local evaluation: TRUE Environment: 0x000001ef77c66610 Capture standard output: TRUE Capture condition classes: 'condition' (excluding 'nothing') Globals: Packages: L'Ecuyer-CMRG RNG seed: (seed = FALSE) Resolved: TRUE Value: Conditions captured: Early signaling: FALSE Owner process: 11c90230-c65c-8903-e2b5-0c16676e899e Class: 'ClusterFuture', 'MultiprocessFuture', 'Future', 'environment' DEBUG: END TROUBLESHOOTING HELP Future UUID: 04cd88b3-f8ad-06fa-7e1f-93d2c24fcff4 DEBUG: BEGIN TROUBLESHOOTING HELP Future involved: ClusterFuture: Label: '' Expression: [1] 42 Lazy evaluation: FALSE Asynchronous evaluation: TRUE Local evaluation: TRUE Environment: R_GlobalEnv Capture standard output: TRUE Capture condition classes: 'condition' (excluding 'nothing') Globals: Packages: L'Ecuyer-CMRG RNG seed: (seed = FALSE) Resolved: TRUE Value: Conditions captured: Early signaling: FALSE Owner process: 11c90230-c65c-8903-e2b5-0c16676e899e Class: 'ClusterFuture', 'MultiprocessFuture', 'Future', 'environment' DEBUG: END TROUBLESHOOTING HELP List of 2 $ message: chr "Package 'future' is not installed on worker (r_version: R Under development (unstable) (2024-03-25 r86192 ucrt)"| __truncated__ $ call : NULL - attr(*, "class")= chr [1:4] "FutureError" "error" "FutureCondition" "condition" - attr(*, "uuid")= chr "04cd88b3-f8ad-06fa-7e1f-93d2c24fcff4" - attr(*, "future")=Classes 'ClusterFuture', 'MultiprocessFuture', 'Future', 'environment' List of 2 $ message: chr "Package 'future' is not installed on worker (r_version: R Under development (unstable) (2024-03-25 r86192 ucrt)"| __truncated__ $ call : NULL - attr(*, "class")= chr [1:4] "FutureError" "error" "FutureCondition" "condition" - attr(*, "uuid")= chr "04cd88b3-f8ad-06fa-7e1f-93d2c24fcff4" - attr(*, "future")=Classes 'ClusterFuture', 'MultiprocessFuture', 'Future', 'environment' Future UUID: 043a4e78-df91-5951-335a-53ed70d7ca32 DEBUG: BEGIN TROUBLESHOOTING HELP Future involved: ClusterFuture: Label: '' Expression: [1] 42 Lazy evaluation: FALSE Asynchronous evaluation: TRUE Local evaluation: TRUE Environment: R_GlobalEnv Capture standard output: TRUE Capture condition classes: 'condition' (excluding 'nothing') Globals: Packages: L'Ecuyer-CMRG RNG seed: (seed = FALSE) Resolved: TRUE Value: Conditions captured: Early signaling: FALSE Owner process: 11c90230-c65c-8903-e2b5-0c16676e899e Class: 'ClusterFuture', 'MultiprocessFuture', 'Future', 'environment' DEBUG: END TROUBLESHOOTING HELP Test set #1 with cluster type 'PSOCK' ... DONE > > message("*** cluster() ... DONE") *** cluster() ... DONE > > source("incl/end.R") Failed to undo environment variables: - Expected environment variables: [n=204] '!ExitCode', 'ALLUSERSPROFILE', 'APPDATA', 'BIBINPUTS', 'BINDIR', 'BSTINPUTS', 'COMMONPROGRAMFILES', 'COMPUTERNAME', 'COMSPEC', 'CURL_CA_BUNDLE', 'CYGWIN', 'CommonProgramFiles(x86)', 'CommonProgramW6432', 'DriverData', 'HOME', 'HOMEDRIVE', 'HOMEPATH', 'JAGS_ROOT', 'JAVA_HOME', 'LANGUAGE', 'LC_COLLATE', 'LC_MONETARY', 'LC_TIME', 'LOCALAPPDATA', 'LOGONSERVER', 'LS_HOME', 'LS_LICENSE_PATH', 'MAKE', 'MAKEFLAGS', 'MAKELEVEL', 'MFLAGS', 'MSMPI_BENCHMARKS', 'MSMPI_BIN', 'MSYS2_ENV_CONV_EXCL', 'NUMBER_OF_PROCESSORS', 'OCL', 'OMP_THREAD_LIMIT', 'OS', 'PATH', 'PATHEXT', 'PROCESSOR_ARCHITECTURE', 'PROCESSOR_IDENTIFIER', 'PROCESSOR_LEVEL', 'PROCESSOR_REVISION', 'PROGRAMFILES', 'PROMPT', 'PSModulePath', 'PUBLIC', 'PWD', 'ProgramData', 'ProgramFiles(x86)', 'ProgramW6432', 'RTOOLS43_HOME', 'RTOOLS44_HOME', 'R_ARCH', 'R_BROWSER', 'R_BZIPCMD', 'R_CMD', 'R_COMPILED_BY', 'R_CRAN_WEB', 'R_CUSTOM_TOOLS_PATH', 'R_CUSTOM_TOOLS_SOFT', 'R_DOC_DIR', 'R_ENVIRON_USER', 'R_GSCMD', 'R_GZIPCMD', 'R_HOME', 'R_INCLUDE_DIR', 'R_INSTALL_TAR', 'R_LIBS', 'R_LIBS_SITE', 'R_LIBS_USER', 'R_MAX_NUM_DLLS', 'R_OSTYPE', 'R_PAPERSIZE', 'R_PAPERSIZE_USER', 'R_PARALLELLY_MAKENODEPSOCK_AUTOKILL', 'R_PARALLELLY_MAKENODEPSOCK_CONNECTTIMEOUT', 'R_PARALLELLY_MAKENODEPSOCK_RSCRIPT_LABEL', 'R_PARALLELLY_MAKENODEPSOCK_SESSIONINFO_PKGS', 'R_PARALLELLY_MAKENODEPSOCK_TIMEOUT', 'R_PARALLELLY_RANDOM_PORTS', 'R_PARALLEL_PORT', 'R_RD4PDF', 'R_RTOOLS44_PATH', 'R_SCRIPT_LEGACY', 'R_SHARE_DIR', 'R_TESTS', 'R_UNZIPCMD', 'R_USER', 'R_VERSION', 'R_ZIPCMD', 'SED', 'SHLVL', 'SYSTEMDRIVE', 'SYSTEMROOT', 'TAR', 'TAR_OPTIONS', 'TEMP', 'TERM', 'TEXINPUTS', 'TMP', 'TMPDIR', 'USERDOMAIN', 'USERDOMAIN_ROAMINGPROFILE', 'USERNAME', 'USERPROFILE', 'WINDIR', '_', '_R_CHECK_AUTOCONF_', '_R_CHECK_BOGUS_RETURN_', '_R_CHECK_BROWSER_NONINTERACTIVE_', '_R_CHECK_BUILD_VIGNETTES_SEPARATELY_', '_R_CHECK_CODETOOLS_PROFILE_', '_R_CHECK_CODE_ASSIGN_TO_GLOBALENV_', '_R_CHECK_CODE_ATTACH_', '_R_CHECK_CODE_CLASS_IS_STRING_', '_R_CHECK_CODE_DATA_INTO_GLOBALENV_', '_R_CHECK_CODE_USAGE_VIA_NAMESPACES_', '_R_CHECK_CODE_USAGE_WITHOUT_LOADING_', '_R_CHECK_CODE_USAGE_WITH_ONLY_BASE_ATTACHED_', '_R_CHECK_CODOC_VARIABLES_IN_USAGES_', '_R_CHECK_COMPACT_DATA2_', '_R_CHECK_COMPILATION_FLAGS_', '_R_CHECK_CONNECTIONS_LEFT_OPEN_', '_R_CHECK_CRAN_INCOMING_', '_R_CHECK_CRAN_INCOMING_CHECK_FILE_URIS_', '_R_CHECK_CRAN_INCOMING_CHECK_URLS_IN_PARALLEL_', '_R_CHECK_CRAN_INCOMING_NOTE_GNU_MAKE_', '_R_CHECK_CRAN_INCOMING_REMOTE_', '_R_CHECK_CRAN_INCOMING_USE_ASPELL_', '_R_CHECK_DATALIST_', '_R_CHECK_DEPRECATED_DEFUNCT_', '_R_CHECK_DOC_SIZES2_', '_R_CHECK_DOT_FIRSTLIB_', '_R_CHECK_DOT_INTERNAL_', '_R_CHECK_EXAMPLE_TIMING_THRESHOLD_', '_R_CHECK_EXECUTABLES_', '_R_CHECK_EXECUTABLES_EXCLUSIONS_', '_R_CHECK_FF_CALLS_', '_R_CHECK_FF_DUP_', '_R_CHECK_FORCE_SUGGESTS_', '_R_CHECK_FUTURE_FILE_TIMESTAMPS_', '_R_CHECK_FUTURE_FILE_TIMESTAMPS_LEEWAY_', '_R_CHECK_HAVE_MYSQL_', '_R_CHECK_HAVE_ODBC_', '_R_CHECK_HAVE_PERL_', '_R_CHECK_HAVE_POSTGRES_', '_R_CHECK_INSTALL_DEPENDS_', '_R_CHECK_INTERNALS2_', '_R_CHECK_LENGTH_1_CONDITION_', '_R_CHECK_LICENSE_', '_R_CHECK_LIMIT_CORES_', '_R_CHECK_MATRIX_DATA_', '_R_CHECK_MBCS_CONVERSION_FAILURE_', '_R_CHECK_NATIVE_ROUTINE_REGISTRATION_', '_R_CHECK_NEWS_IN_PLAIN_TEXT_', '_R_CHECK_NO_RECOMMENDED_', '_R_CHECK_NO_STOP_ON_TEST_ERROR_', '_R_CHECK_ORPHANED_', '_R_CHECK_OVERWRITE_REGISTERED_S3_METHODS_', '_R_CHECK_PACKAGES_USED_IGNORE_UNUSED_IMPORTS_', '_R_CHECK_PACKAGES_USED_IN_TESTS_USE_SUBDIRS_', '_R_CHECK_PACKAGE_DATASETS_SUPPRESS_NOTES_', '_R_CHECK_PACKAGE_NAME_', '_R_CHECK_PKG_SIZES_', '_R_CHECK_PKG_SIZES_THRESHOLD_', '_R_CHECK_PRAGMAS_', '_R_CHECK_RD_EXAMPLES_T_AND_F_', '_R_CHECK_RD_LINE_WIDTHS_', '_R_CHECK_RD_MATH_RENDERING_', '_R_CHECK_RD_NOTE_LOST_BRACES_', '_R_CHECK_RD_VALIDATE_RD2HTML_', '_R_CHECK_REPLACING_IMPORTS_', '_R_CHECK_R_DEPENDS_', '_R_CHECK_S3_METHODS_SHOW_POSSIBLE_ISSUES_', '_R_CHECK_SCREEN_DEVICE_', '_R_CHECK_SERIALIZATION_', '_R_CHECK_SHLIB_OPENMP_FLAGS_', '_R_CHECK_SRC_MINUS_W_IMPLICIT_', '_R_CHECK_SUBDIRS_NOCASE_', '_R_CHECK_SUGGESTS_ONLY_', '_R_CHECK_SYSTEM_CLOCK_', '_R_CHECK_TESTS_NLINES_', '_R_CHECK_TEST_TIMING_', '_R_CHECK_TIMINGS_', '_R_CHECK_TOPLEVEL_FILES_', '_R_CHECK_UNDOC_USE_ALL_NAMES_', '_R_CHECK_UNSAFE_CALLS_', '_R_CHECK_URLS_SHOW_301_STATUS_', '_R_CHECK_VC_DIRS_', '_R_CHECK_VIGNETTES_NLINES_', '_R_CHECK_VIGNETTES_SKIP_RUN_MAYBE_', '_R_CHECK_VIGNETTE_TIMING_', '_R_CHECK_VIGNETTE_TITLES_', '_R_CHECK_WINDOWS_DEVICE_', '_R_CHECK_XREFS_USE_ALIASES_FROM_CRAN_', '_R_CLASS_MATRIX_ARRAY_', '_R_DEPRECATED_IS_R_', '_R_S3_METHOD_LOOKUP_BASEENV_AFTER_GLOBALENV_', '_R_SHLIB_BUILD_OBJECTS_SYMBOL_TABLES_', '__R_CHECK_DOC_FILES_NOTE_IF_ALL_SPECIAL__', 'maj.version', 'nextArg--timingsnextArg--install' - Environment variables still there: [n=0] - Environment variables missing: [n=1] 'MAKEFLAGS' Differences environment variable by environment variable: List of 3 $ name : chr "MAKEFLAGS" $ expected: 'Dlist' chr "" $ actual : 'Dlist' chr NA > > proc.time() user system elapsed 0.28 0.12 0.73