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

Run tests in parallel with pytest-xdist #336

Closed
jvavrek opened this issue Apr 5, 2022 · 4 comments · Fixed by #337
Closed

Run tests in parallel with pytest-xdist #336

jvavrek opened this issue Apr 5, 2022 · 4 comments · Fixed by #337

Comments

@jvavrek
Copy link
Contributor

jvavrek commented Apr 5, 2022

@jvavrek can we change the tests to use xdist and run in parallel?

Originally posted by @jccurtis in #333 (comment)

I was unable to get pytest-xdist to work properly—it seems to cause race conditions when used in conjunction with pytest-cov. Perhaps we can revisit this in the future. See the original post for further discussion on the original attempt.

@RobJY
Copy link

RobJY commented Apr 8, 2022

I found this post on SO that suggests adding --dist=loadfile to the call to pytest to get all the tests in a given file to run on the same worker. I tried this on a Docker container running the Python 3.9 image and went from getting multiple failed tests to none. I'm only running on a small number of cores so maybe it still fails with more cores. Seems like this should help though if not solve the issue.

Happy to test on other versions of Python or share my Dockerfile if it would help.

@jccurtis
Copy link
Collaborator

jccurtis commented Apr 8, 2022

@RobJY that is a great find. Thank you for that! @jvavrek want me to make a separate PR with just feature?

@jvavrek
Copy link
Contributor Author

jvavrek commented Apr 8, 2022

@RobJY that is a great find. Thank you for that! @jvavrek want me to make a separate PR with just feature?

@jccurtis if you have time for it. If not, I can try it this afternoon.

@jccurtis
Copy link
Collaborator

jccurtis commented Apr 8, 2022

@jvavrek see #337

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants