sneumann / xcms

This is the git repository matching the Bioconductor package xcms: LC/MS and GC/MS Data Analysis
Other
183 stars 80 forks source link

build error on BioC on Windows in testthat #582

Closed sneumann closed 2 years ago

sneumann commented 2 years ago

Hi, for a while we have an error in CHECK http://bioconductor.org/checkResults/devel/bioc-LATEST/xcms/riesling1-checksrc.html due to an issue of testthat itself:

* checking tests ...
** running tests for arch 'i386' ...
  Running 'testthat.R'
Warning message:
In file.rename(outfile, paste0(outfile, ".fail")) :
  cannot rename file 'testthat.Rout' to 'testthat.Rout.fail', reason 'The process cannot access the file because it is being used by another process'
 ERROR
** running tests for arch 'x64' ...
  Running 'testthat.R'
Warning message:
In file.rename(outfile, paste0(outfile, ".fail")) :
  cannot rename file 'testthat.Rout' to 'testthat.Rout.fail', reason 'The process cannot access the file because it is being used by another process'
 ERROR

On the BioC slack Hervé Pagès suggested:

We tend to see this when the code in the unit tests spans processes that hold on testthat.Rout even after the tests have finished. This happens for example if you use parallel evaluation. It only causes problems on Windows because this OS refuses to rename a file if another process is holding on it. ... my personal recommendation is to disable parallelization only on Windows, and run the tests only > for the 64-bit arch

Yours, Steffen

sneumann commented 2 years ago

Skipping things can be done with skip_on...() from testthat: https://rdrr.io/cran/testthat/man/skip.html like skip_on_os(os="windows", arch="x86") or directly in https://github.com/sneumann/xcms/blob/master/tests/testthat.R#L66

jorainer commented 2 years ago

skipping all unit tests on i386 would also have the side effect that we don't run into time issues with too long tests on Windows anymore... +1 for that

sneumann commented 2 years ago

Fixed in 105d50393972374c907519174385774c45b5177c and released as xcms 3.15.5