Skip to content
Prev 9461 / 12125 Next

[R-pkg-devel] Trouble with long-running tests on CRAN debian server

Thanks Dirk and Ivan,

I took a slightly different work-around of forcing the number of threads to
1 when running functions of the test dataset in the package, by adding the
following to each user facing function:

```
  # Check if running on package test_data, and if so, force data.table to
be
  # single threaded so that we can avoid a NOTE on CRAN submission
  if (isTRUE(all.equal(x, ukbnmr::test_data))) {
    registered_threads <- getDTthreads()
    setDTthreads(1)
    on.exit({ setDTthreads(registered_threads) }) # re-register so no
unintended side effects for users
  }
```
(i.e. here x is the input argument to the function)

It took some trial and error to get to pass the CRAN tests; the number of
columns in the input data was also contributing to the problem.

Best,

Scott
On Mon, 21 Aug 2023 at 14:38, Dirk Eddelbuettel <edd at debian.org> wrote: