Skip to content

Commit

Permalink
retry on failure + revert commit d7488c6; still not working
Browse files Browse the repository at this point in the history
  • Loading branch information
HenrikBengtsson committed Jun 18, 2024
1 parent d7488c6 commit 5d8a159
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/mirai_cluster,worker-termination.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ stopifnot(free == 2L)
## Don't test on MS Windows, because that will leave behind a
## stray Rscript<hexcode> file, which 'R CMD check --as-cran'
## will complain about. /HB 2024-04-12
## This have been fixed in R-devel ("4.5.0") /HB 2024-06-18
if (.Platform$OS.type != "windows" || getRversion() >= "4.5.0") {
if (.Platform$OS.type != "windows") {
## Force R worker to quit
f <- future({ tools::pskill(pid = Sys.getpid()) })
res <- tryCatch(value(f), error = identity)
Expand All @@ -28,6 +27,13 @@ if (.Platform$OS.type != "windows" || getRversion() >= "4.5.0") {
print(nworkers)
if (!inherits(nworkers, "error")) {
message("Number of workers: ", nworkers)
message("Expected number of workers: ", all - 1L)
count <- 0L
while (nworkers != all - 1L && count < 5L) {
Sys.sleep(1.0)
nworkers <- tryCatch(nbrOfWorkers(), error = identity)
message("Number of workers: ", nworkers)
}
stopifnot(nworkers == all - 1L)
}

Expand Down

0 comments on commit 5d8a159

Please sign in to comment.