Re: [R-pkg-devel] R CMD Check: Tests running infinite

2017-02-07 Thread Henrik Bengtsson
On Tue, Feb 7, 2017 at 2:10 PM, Gábor Csárdi wrote: > On Tue, Feb 7, 2017 at 8:16 PM, Henrik Bengtsson > wrote: > [...] >> >> >> So, to me it's not clear how this could make a difference in Patrick >> case. By disabling this, i.e. Sys.setenv(R_TESTS=""), I don't see >> how it affects running pa

Re: [R-pkg-devel] R CMD Check: Tests running infinite

2017-02-07 Thread Patrick Schratz
> > Nevertheless, putting an empty startup.Rs file in tests/testthat fixes the > testParallel > package as well. Works for me as well! 2017-02-07 23:10 GMT+01:00 Gábor Csárdi : > On Tue, Feb 7, 2017 at 8:16 PM, Henrik Bengtsson < > henrik.bengts...@gmail.com> wrote: > [...] > >> >> So, to me it

Re: [R-pkg-devel] R CMD Check: Tests running infinite

2017-02-07 Thread Patrick Schratz
> > I would be curious > to see what file.path(R.home("share"), "R", "tests-startup.R") > contains on the system where the problem occurs. Contents of mine on macOS are the same as on your Ubuntu: ## A custom startup file for tests ## Run as if a system Rprofile, so no packages, no assignments o

Re: [R-pkg-devel] R CMD Check: Tests running infinite

2017-02-07 Thread Gábor Csárdi
On Tue, Feb 7, 2017 at 8:16 PM, Henrik Bengtsson wrote: [...] > > So, to me it's not clear how this could make a difference in Patrick > case. By disabling this, i.e. Sys.setenv(R_TESTS=""), I don't see > how it affects running parallel+foreach+doParallel. Maybe because one > of those packages

Re: [R-pkg-devel] R CMD Check: Tests running infinite

2017-02-07 Thread Gábor Csárdi
On Tue, Feb 7, 2017 at 8:16 PM, Henrik Bengtsson wrote: [...] > I wonder if those are mostly there because of cut'n'paste behavior. > I don't know. What I know is that I have seen it in about 5 of my packages, and I have also helped about 5 people that were stumbled upon it with their own packag

Re: [R-pkg-devel] R CMD Check: Tests running infinite

2017-02-07 Thread Hadley Wickham
>> A lot of packages have to work around this: >> https://github.com/search?q=user%3Acran+R_TESTS&type=Code > > I wonder if those are mostly there because of cut'n'paste behavior. It's not something I've ever advocated; I didn't realise there were so many people unsetting it. (devtools does it for

Re: [R-pkg-devel] R CMD Check: Tests running infinite

2017-02-07 Thread Henrik Bengtsson
On Mon, Feb 6, 2017 at 12:41 AM, Gábor Csárdi wrote: > I don't think it is specific for testthat. R CMD check sets R_TESTS when it > runs the tests, so the separate R process it starts can have some special > startup options. > > The problem happens if you start another R process from your R test,

Re: [R-pkg-devel] R CMD Check: Tests running infinite

2017-02-06 Thread Gábor Csárdi
I don't think it is specific for testthat. R CMD check sets R_TESTS when it runs the tests, so the separate R process it starts can have some special startup options. The problem happens if you start another R process from your R test, and then R_TESTS confuses this process. (I am not sure how exa

Re: [R-pkg-devel] R CMD Check: Tests running infinite

2017-02-05 Thread Henrik Bengtsson
In case someone else bumps into this later and finds this thread; can you confirm that this was a problem specific to using the testthat package for running the tests? /Henrik On Sun, Feb 5, 2017 at 11:28 AM, Patrick Schratz wrote: > @gaborcsardi solved it :) See here: > https://github.com/hadle

Re: [R-pkg-devel] R CMD Check: Tests running infinite

2017-02-05 Thread Patrick Schratz
@gaborcsardi solved it :) See here: https://github.com/hadley/testthat/issues/567#issuecomment-277536577 2017-02-05 16:07 GMT+01:00 Patrick Schratz : > Thanks for the hint, Hendrik! > However, this change did not make a difference :/ > > I tried to use all cluster closing functions I came across

Re: [R-pkg-devel] R CMD Check: Tests running infinite

2017-02-05 Thread Patrick Schratz
Thanks for the hint, Hendrik! However, this change did not make a difference :/ I tried to use all cluster closing functions I came across but tests are still running infinite.. *cl <- makeCluster(par.args$par.units, outfile = out.progress)* *registerDoParallel(cl)* *foreach()* *parallel::stop

Re: [R-pkg-devel] R CMD Check: Tests running infinite

2017-02-05 Thread Henrik Bengtsson
Use registerDoParallel(cl) The number of parallel workers is already contained in the 'cl' object, so don't specify 'cores'! (If you do that, I suspect you create yet another cluster (a multicore one) which is used but never closed) registerDoParallel() should ideally give an error in your ca

Re: [R-pkg-devel] R CMD Check: Tests running infinite

2017-02-05 Thread Patrick Schratz
Dear Uwe, thanks for the hint. My cluster is closed after the `foreach`call using `stopCluster()`. Before, I´ll do the following to init the cluster: *cl <- makeCluster(par.args$par.units, outfile = out.progress)* *registerDoParallel(cl, cores = par.args$par.units)* *foreach()* *stopCluster(cl

Re: [R-pkg-devel] R CMD Check: Tests running infinite

2017-02-01 Thread Uwe Ligges
Check whether the parallel cluster is closed. Can it be that the cluster is still open and the check process waits for them to complete? Best, Uwe Ligges On 31.01.2017 13:45, Patrick Schratz wrote: Hello, when running R CMD check / devtools::check, section "running tests..." is not finishin

[R-pkg-devel] R CMD Check: Tests running infinite

2017-02-01 Thread Patrick Schratz
Hello, when running R CMD check / devtools::check, section "running tests..." is not finishing (40 min+). *Checking tests only works:* *==> Sourcing R files in 'tests' directory* *testthat results * *OK: 7 SKIPPED: 0 FAILED: 0* *T