-
Notifications
You must be signed in to change notification settings - Fork 118
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
Bug? in 3.2.0 for tests using parallel mclapply #335
Comments
Actually just found this thread saying parallel stuff is not tracked by covr... |
I guess you can close the issue maybe a warning when encountering parallel code would be handy :) |
If you give me the package you are trying to run I can look at it. |
I just run into the same situation (package OncoSimulR's tests were exhausting the memory in both my laptop and TravisCI --- https://api.travis-ci.org/v3/job/432504775/log.txt; this did not happen with the same code with version 3.1.0 of covr). The following test.something.R file (in, say, the testthtat's directory of the package) shows the problem.
If one runs under covr 3.2.0, one can see more than 20 R processes running. Under covr 3.1.0 one only sees the expected three (parent + 2 children) all the time. It looks like something gets confused and multiple mclapplys (respecting the mc.cores = 2, though) are being run recursively. If one adds the I am not sure if this is an issue with covr or with mclapply. It certainly did not happen with covr 3.1.0 (or earlier). These are two images from doing (notice the multiple nested pairs) and the second from covr 3.1.0 or from covr 3.2.0 and |
It is not just (Trying this "for real" with OncoSimulR, and fixing the mclapply call to use |
@rdiaz02, thank you for providing a package that illustrates the issue, I was able to reproduce it and fix it yesterday. There was an issue with how the mcexit patch was being applied. |
@jimhester thank you for the fast fix (and the package). |
I have a function that uses parallel::mclapply and in tests I call it with ncores = 2
It passes the tests and coverage worked fine until new version 3.2.0 was released
Now coverage fails claiming that the tests with parallel crashes whereas the test itself does not break.
If I change the argument in the tests to ncores = 1 coverage works again...
Hard to give my example here but if necessary I can try recreate the bug ( looks like parallel breaks sthg in covr?) maybe it s intentional so that "if in covr mode we should not use multicore" but I didnt know then...
The text was updated successfully, but these errors were encountered: