Skip to content

Commit

Permalink
make test more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau-lilly committed Oct 2, 2024
1 parent 378e3c1 commit cad8d9c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/local/test-transient.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ crew_test("backlog of tasks for transient workers", {
time <- system.time({
for (index in seq_len(n)) {
name <- paste0("task_", index)
x$push(name = name, command = ps::ps_pid())
x$push(name = name, command = Sys.getenv("CREW_INSTANCE"))
}
})
message(time["elapsed"])
# Launch many more tasks.
time <- system.time({
for (index in seq_len(n)) {
name <- paste0("task_", index)
x$push(name = name, command = ps::ps_pid())
x$push(name = name, command = Sys.getenv("CREW_INSTANCE"))
}
})
message(time["elapsed"])
Expand All @@ -38,7 +38,7 @@ crew_test("backlog of tasks for transient workers", {
message(time["elapsed"])
testthat::expect_equal(sum(x$launcher$summary()$launches), 2 * n)
results <- tibble::as_tibble(do.call(rbind, results))
results$result <- as.integer(results$result)
results$result <- as.character(results$result)
testthat::expect_equal(length(unique(results$result)), 2 * n)
x$terminate()
})

0 comments on commit cad8d9c

Please sign in to comment.