Skip to content

Conversation

@bcmyguest
Copy link

Description Of Changes

From an idea in here: #3901

Attempting to turn on parallel testing in CI to speed up testing. Locally testing it seemed to work but who knows once it gets in the wild.

Definite DISadvantage here is that it screws up pluggy, but that's only really relevant when running locally anyways and it's not enabled by default. Another possible issue is that matplotlib is not thread safe, so I am not sure how tests will interact with that, it could end up being more flaky than it's worth.

Checklist

  • Tests added -> nope
  • Fully documented -> updated contributing.md

@bcmyguest bcmyguest requested a review from a team as a code owner August 26, 2025 23:27
@bcmyguest bcmyguest requested review from dopplershift and removed request for a team August 26, 2025 23:27
@bcmyguest
Copy link
Author

bcmyguest commented Aug 26, 2025

Obviously something wonky going on with the coverage but as a POC I think this works (tests run, and they run much faster). I think we would need to use pytest-cov https://pytest-cov.readthedocs.io/en/latest/xdist.html

^ did this

@bcmyguest bcmyguest changed the title WIP chore: parallelize testing in ci with xdist chore: parallelize testing in ci with xdist Aug 27, 2025
Removed '--cov-branch' from default pytest arguments.
@DWesl
Copy link
Contributor

DWesl commented Aug 30, 2025

Another possible issue is that matplotlib is not thread safe, so I am not sure how tests will interact with that, it could end up being more flaky than it's worth.

For that part of the issue, you could mark the plotting tests, run the non-plotting tests in parallel then the plotting tests serially. MetPy probably has enough non-plotting tests this would speed things up

@bcmyguest
Copy link
Author

bcmyguest commented Sep 2, 2025

@DWesl it actually seemed to be working alright - xdist uses subprocesses instead of threads :) As long as you don't pollute the test namespace with tests that use the same files (eg testing output.png on different processes)

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 this pull request may close these issues.

2 participants