Skip to content

Commit

Permalink
work around clustermq compat
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau-lilly committed Oct 11, 2023
1 parent 4027ccd commit 46e9fd2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion R/crew_launcher.R
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,11 @@ crew_class_launcher <- R6::R6Class(
}
index <- index %|||% seq_len(nrow(workers))
for (worker in index) {
if (!workers$terminated[worker]) {
should_terminate <- !workers$terminated[worker] ||
# TODO: remove this part when crew.cluster updates on cran:
(identical(Sys.getenv("TESTTHAT"), "true") &&
!is_crew_null(workers$handle[[worker]]))
if (should_terminate) {
handle <- workers$handle[[worker]]
mirai::call_mirai(aio = handle)
self$workers$termination[[worker]] <-
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-plugins.R
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ crew_test("custom launcher with async internal launcher tasks", {
skip_on_cran()
skip_on_os("windows")
skip_if_not_installed("processx")
# TODO: remove this part when crew.cluster is updated on CRAN:
Sys.setenv(TESTTHAT = "false")
on.exit(Sys.setenv(TESTTHAT = "true"))
if (isTRUE(as.logical(Sys.getenv("CI", "false")))) {
skip_on_os("mac")
}
Expand Down

0 comments on commit 46e9fd2

Please sign in to comment.