Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R CMD check freezes when a test contains parallel calls #36

Closed
gvegayon opened this issue Sep 12, 2019 · 6 comments
Closed

R CMD check freezes when a test contains parallel calls #36

gvegayon opened this issue Sep 12, 2019 · 6 comments
Labels
bug Something isn't working

Comments

@gvegayon
Copy link

I've been trying to switch some of my R packages to the tinytest framework. In some of them, I use the parallel package, i.e. parallel::makeCluster() and that doesn't seem to work with tinytest. To show this, I've created a small toy package with a single function: hello_parallel, which creates a cluster object cl and calls parallel::clusterEvalQ(cl, "hello"). Running tinytest::test_all works fine, but R CMD check freezes.

Here is the repo where I put the toy package:

https://github.com/USCbiostats/tinytesttest

Here is one example of tinytest failing (freezing) during R CMD check:

https://travis-ci.org/USCbiostats/tinytesttest/builds/584236824#L728

I had to stop this build after 9 minutes running.

Also, a similar issue happens when I call R using system calls, e.g. system2("R", ...).

@gvegayon
Copy link
Author

And here is a travis build that timeout b/c of no output in the last 10 minutes
https://travis-ci.org/USCbiostats/tinytesttest/builds/584238339

@markvanderloo
Copy link
Owner

Thanks, I've now confirmed this locally. Bit of a riddle at the moment, I have to dig through some documentation to see where this comes from. Also, big thanks for setting up the test package.

@markvanderloo
Copy link
Owner

Ok it seems to be similar to this issue in testthat. I managed to avoid the trouble by setting

Sys.setenv("R_TESTS"="")

in the beginning of the test file.

Note: you do not need to unset the envvar at the end because tinytest does this automatically for you after running the test file (so R_TESTS only has a different value from the original one while this particular file runs).

It is a hack and a workaround but maybe you can now at least keep working while I look for a real solution.

@gvegayon
Copy link
Author

Yes, that seems to work fine. Thanks!

@markvanderloo
Copy link
Owner

Fixed, tested with tinytesttest, also affects #37 0ab0659

@markvanderloo markvanderloo added the bug Something isn't working label Sep 25, 2019
@gvegayon
Copy link
Author

Awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants