Skip to content

Commit

Permalink
Fix #1182
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau-lilly committed Dec 4, 2023
1 parent 2eb3b09 commit 2d9f4fe
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions tests/hpc/test-crew_local.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ tar_test("heavily parallel workload should run fast", {
expect_equal(tar_outdated(callr_function = NULL), character(0))
})

tar_test("saturated controllers should not get tasks", {
tar_test("saturated controllers should get tasks", {
# Also watch CPU usage on htop. Should be low.
skip_on_cran()
skip_if_not_installed("crew")
Expand All @@ -135,27 +135,6 @@ tar_test("saturated controllers should not get tasks", {
tar_target(z, Sys.sleep(10))
)
})
tar_make() # First two should start, then a pause, then the next two.
expect_equal(tar_outdated(callr_function = NULL), character(0))
})

tar_test("controllers are assessed individually for saturation in a group", {
skip_on_cran()
skip_if_not_installed("crew")
tar_script({
library(targets)
a <- crew::crew_controller_local(name = "a", workers = 2)
b <- crew::crew_controller_local(name = "b", workers = 2)
tar_option_set(controller = crew::crew_controller_group(a, b))
resources_a <- tar_resources(crew = tar_resources_crew(controller = "a"))
resources_b <- tar_resources(crew = tar_resources_crew(controller = "b"))
list(
tar_target(w, Sys.sleep(5), resources = resources_a),
tar_target(x, Sys.sleep(5), resources = resources_a),
tar_target(y, Sys.sleep(5), resources = resources_b),
tar_target(z, Sys.sleep(5), resources = resources_b)
)
})
tar_make() # All 4 should start at once and finish at once.
tar_make() # All 4 targets should start and the last 2 should be "pending".
expect_equal(tar_outdated(callr_function = NULL), character(0))
})

0 comments on commit 2d9f4fe

Please sign in to comment.