-
-
Notifications
You must be signed in to change notification settings - Fork 438
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
Race conditions when using 'tox --parallel' #1514
Comments
I don't see the errors you mention:
But I wouldn't expect one .coverage file to be used by multiple processes simultaneously anyway. You can use the I'll close this issue, but please do re-open if I've misunderstood something. |
Hmm, I'm curious why we're seeing different results. I just did a fresh clone of the repo and ran the parallel instantiation, here's the output:
As far as your suggestion to use
After I make that change, the error changes to a different error, but it still doesn't succeed:
|
@nedbat I don't seem to have the ability to re-open the issue, but I've posted the comments above. |
Trying to make a reproducible environment - here's a
After that is built (using For me, in this Docker environment, it took a few iterations to see the failure:
|
If this is still a problem for you, can you try adding this line to your coverage configuration?
|
Interesting, didn't think about that. So every thread will produce a different coverage report, then aggregate in the end? |
It works a little better like this: [run]
data_file = .coverage.${TOX_ENV_NAME} (dot instead of dash) Then each tox environment produces its own file without conflict. You can then combine them all together with:
|
Thanks for picking up this thread again. Here's the incantation I've been using in my
where
That's a bit different - I'd welcome your thoughts on some of the differences, including:
Just asking in the spirit of getting some broad recommendations for people in general "out there" to follow - it definitely took me a long time to get "something that works", but I'd be more than willing to scrap it for something else better if appropriate! |
These all seem fine. You are using values available in the tox.ini file, I am using environment variables, but they have the same effect. I try to avoid pytest-cov, because it doesn't add things that I need, and it's one more component to understand and control. This feels like one of those things to try to document somehow.... |
I'm getting something very similar to this, here is my error:
I have environments 6 environments, and run 4-sh at a time, one python version at a time.
and one of the build always fails randomly. Can't figure out why. |
Describe the bug
I've been getting a lot of errors about "no such table" or "table already exists" when trying to run
tox
with coverage reporting. It looks a fair amount like #1303, but I'm opening a new issue because it looks like at least one problem was already solved in that ticket, and the existing issue has gotten kind of complicated over time.This means that users can't use parallel testing at the same time as coverage reporting.
To Reproduce
git clone git@github.com:kenahoo/pkg-test-coverage-bug.git
tox
.python -m tox
and (hopefully) observe that everything passes.python -m tox --parallel auto
and (hopefully) observe that things fail with the above errors.If the above doesn't demonstrate the problem, I can try to provide additional context, let me know.
Notes
This is important in my organization, because we need to assure compatibility with several dependency chains, and the tests take a while, so parallel testing is very important to get timely feedback.
The text was updated successfully, but these errors were encountered: