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

[RFC] Use pytest-xdist in setuptools' test suite #2458

Closed
webknjaz opened this issue Nov 18, 2020 · 3 comments · Fixed by #2459
Closed

[RFC] Use pytest-xdist in setuptools' test suite #2458

webknjaz opened this issue Nov 18, 2020 · 3 comments · Fixed by #2459

Comments

@webknjaz
Copy link
Member

webknjaz commented Nov 18, 2020

As I see it, there's two benefits of doing so:

  1. Getting the test results faster. For example, on my laptop, a single pytest run takes 175s (2min 54s) but adding pytest-xdist makes it 52.04s. That's about x3.5 speedup. When talking about getting the CI reports, the speedup of a single run may be less significant (fewer CPU cores used) but if you multiply that per job number across all CIs, this may be quite useful.
  2. Identifying bugs in tests: when I added pytest-xdist locally, I've got one error and one failure. This may mean that some of the tests may be leaking state and aren't isolated which becomes visible in envs with race conditions. So adding xdist will also help us isolates tests better.
webknjaz added a commit to webknjaz/setuptools that referenced this issue Nov 18, 2020
webknjaz added a commit to webknjaz/setuptools that referenced this issue Nov 18, 2020
@webknjaz
Copy link
Member Author

Demo PR: #2459.

@jaraco
Copy link
Member

jaraco commented Dec 6, 2020

In my experience on other projects, adding this plugin does add some complexity and additional failure modes and thus debt to a project. That said, I'm generally in favor of the concept. Perhaps it would be worthwhile to first use something like pytest-randomly to eliminate the test dependencies.

webknjaz added a commit to webknjaz/setuptools that referenced this issue Jan 1, 2021
webknjaz added a commit to webknjaz/setuptools that referenced this issue Jan 17, 2021
@webknjaz
Copy link
Member Author

FWIW that PR fixes the problems with tests and makes the suite complete much faster. I'd say we need to explore the randomly plugin separately.

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

Successfully merging a pull request may close this issue.

2 participants