Skip to content

perf: faster test suite with xdist #190

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

Closed
wants to merge 17 commits into from
Closed

perf: faster test suite with xdist #190

wants to merge 17 commits into from

Conversation

beckermr
Copy link
Collaborator

As it says...

@cvanelteren
Copy link
Contributor

The problem is python xdist does not play well with pytest-mpl out of the box.

@cvanelteren
Copy link
Contributor

You could perhaps look at this: matplotlib/pytest-mpl#136 (comment). Ended up not completing it, but it is doable.

@beckermr
Copy link
Collaborator Author

The problem is python xdist does not play well with pytest-mpl out of the box.

What happens? This is something I am happy to look into.

@cvanelteren
Copy link
Contributor

The issue is that the tests need to be collected on a singular thread. The tests are reported correctly, but not put in the correct folder. I was playing around with it in the link above. Was able to get it working but didn't pursue it further to clean it up. Ideally we would merge it with them for native support (and force their hand).

Copy link

codecov bot commented Apr 26, 2025

Codecov Report

Attention: Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
ultraplot/tests/test_format.py 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@beckermr
Copy link
Collaborator Author

So there are multiple bugs related to using xdist here, both due to removing non-failed comparisons and due to writing the report. This will take me longer than I had guessed. :/

@cvanelteren
Copy link
Contributor

I ended up writing s custom html page and just moved the failed test over. But dunno if I still have the code. Will check when I have a computer.

@beckermr
Copy link
Collaborator Author

I tried the code in your issue and it doesn't work with the latest mpl pytest. I plan to look later I am just very busy in the next two weeks.

@cvanelteren
Copy link
Contributor

Couldn't find the code unfortunately :( Thinks I torched the branch.

@beckermr
Copy link
Collaborator Author

I am seeing non-reproducible failures in the main test suite when using xdist in addition to failures in the image comparisons. I think this points to something more fundamentally wrong. So I am going to abandon this PR for now in favor of #213 which gives a 25% reduction in the runtime of the tests without the tricky failures.

@beckermr beckermr closed this May 13, 2025
@beckermr beckermr deleted the faster-tests branch May 13, 2025 11:38
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