Skip to content

Commit

Permalink
Fix refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau-lilly committed Jan 9, 2024
1 parent 4569d16 commit c1ff96c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/controller/minimal.R
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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
)
Expand Down
2 changes: 2 additions & 0 deletions tests/controller/persistent.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)) {
Expand Down

0 comments on commit c1ff96c

Please sign in to comment.