Skip to content

Commit

Permalink
retries in a test
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau committed May 17, 2024
1 parent 8e135c2 commit b8e9fcc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/testthat/test-plugins.R
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,18 @@ crew_test("custom launcher with async internal launcher tasks", {
})
controller$push(name = "pid", command = ps::ps_pid())
controller$wait(seconds_timeout = 10, seconds_interval = 0.5)
out <- controller$pop()$result[[1L]]
envir <- new.env(parent = emptyenv())
crew_retry(
~ {
envir$pid <- controller$pop()$result[[1L]]
!is.null(envir$pid)
},
seconds_interval = 0.25,
seconds_timeout = 15
)
handle <- controller$launcher$workers$handle[[1L]]
pid <- handle$data$pid
expect_equal(out, pid)
expect_equal(envir$pid, pid)
expect_equal(handle$data$status, "started")
controller$launcher$terminate()
handle <- controller$launcher$workers$termination[[1L]]
Expand Down

0 comments on commit b8e9fcc

Please sign in to comment.