tests/local/test-crew_relay.R

crew_test("relay wait() timeout condition", {
  throttle <- crew_throttle(
    seconds_max = 2,
    seconds_min = 2,
    seconds_start = 2,
    base = 1.1
  )
  x <- crew_relay(throttle = throttle)
  cv <- nanonext::cv()
  x$set_from(cv)
  x$start()
  time <- system.time(out <- x$wait())
  expect_false(out)
  expect_gt(time["elapsed"], 1)
  expect_equal(nanonext::cv_value(x$condition), 0L)
  expect_equal(nanonext::cv_value(cv), 0L)
})

Try the crew package in your browser

Any scripts or data that you put into this service are public.

crew documentation built on June 9, 2025, 5:09 p.m.