tests/testthat/test_ClusterFunctionsSocket.R

test_that("cf socket", {
  skip_if_not_installed("snow")
  # skip_on_ci()

  reg = makeTestRegistry()
  reg$cluster.functions = makeClusterFunctionsSocket(2)
  ids = batchMap(Sys.sleep, time = c(5, 5), reg = reg)
  silent({
    submitJobs(1:2, reg = reg)
    expect_equal(findOnSystem(reg = reg), findJobs(reg = reg))
    expect_true(waitForJobs(sleep = 0.5, reg = reg))
  })
  expect_data_table(findOnSystem(reg = reg), nrow = 0)
  expect_equal(findDone(reg = reg), findJobs(reg = reg))
})

Try the batchtools package in your browser

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

batchtools documentation built on April 20, 2023, 5:09 p.m.