diff --git a/tests/controller/minimal.R b/tests/controller/minimal.R index 3cc617d..154ccbd 100644 --- a/tests/controller/minimal.R +++ b/tests/controller/minimal.R @@ -1,7 +1,7 @@ test_that("minimal workload", { definition <- "crew-aws-batch" - queue <- "hpc" - region <- "us-east-2" + queue <- "crew-aws-batch" + region <- "us-east-1" monitor <- crew_monitor_aws_batch( job_definition = definition, job_queue = queue, @@ -25,19 +25,19 @@ test_that("minimal workload", { command = as.character(Sys.info()["nodename"]) ) controller$wait() + id <- controller$launcher$workers$handle[[1L]]$data$jobId message("Waiting for active jobs to be listed as started.") crew::crew_retry( - ~nrow(monitor$active()) > 0L, + ~id %in% monitor$active()$id, seconds_interval = 1, seconds_timeout = 180 ) task <- controller$pop() expect_false(task$result[[1L]] == as.character(Sys.info()["nodename"])) controller$launcher$terminate() - # Assumes no other work is using the crew-aws-batch job definition: message("Waiting for active jobs to terminate.") crew::crew_retry( - ~nrow(monitor$active()) < 1L, + ~!(id %in% monitor$active()$id), seconds_interval = 1, seconds_timeout = 180 ) diff --git a/tests/controller/persistent.R b/tests/controller/persistent.R index a469211..a152f55 100644 --- a/tests/controller/persistent.R +++ b/tests/controller/persistent.R @@ -2,6 +2,7 @@ test_that("persistent worker workload", { definition <- "crew-aws-batch" queue <- "crew-aws-batch" for (processes in list(NULL, 1L)) { + message("Testing a controller.") controller <- crew_controller_aws_batch( name = "my_workflow", workers = 1L, @@ -22,6 +23,7 @@ test_that("persistent worker workload", { message(paste("push", name)) } results <- list() + message("Waiting for results.") while (length(results) < n) { out <- controller$pop() if (!is.null(out)) {