Speed up Ubuntu 24.04 valgrind with pytest-split (2h -> 40min) - #4
Merged
radarhere merged 5 commits intoJul 8, 2026
Merged
Conversation
radarhere
reviewed
Jul 6, 2026
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
radarhere
reviewed
Jul 8, 2026
|
|
||
| - name: Build image | ||
| run: | | ||
| cd ubuntu-24.04-noble-amd64-valgrind && make update |
Owner
There was a problem hiding this comment.
Why doesn't this have sudo chmod a+w like
docker-images/.github/workflows/build.yml
Line 88 in e3ecdef
?
Author
There was a problem hiding this comment.
That other job had already run sudo chown -R 1001 "$(pwd)" which is the UID the tests run with inside the container. We don't need a matching chmod here, we're only building the image.
radarhere
approved these changes
Jul 8, 2026
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates PR python-pillow#272.
Ubuntu 24.04 valgrind takes between 1h43m and 2h02m.
We can use pytest-split to share out the tests between four jobs, which takes the waiting time down to around 42 minutes.
Normally we might use pytest-xdist, but that doesn't mix well with valgrind.
By default, pytest-split shares out the tests evenly. But if you provide a
.test_durationsJSON file of times from a previous run, it will share out to balance by time taken.We don't need to keep this file always up-to-date. New tests without times will be shared out between the jobs, and it won't make too much difference.
Also, refactor the CI a bit for this job. It has a first job that builds the Docker image and then uploads to GitHub artifacts. Then the four parallel jobs start, download this image, and run their quarter of tests. Finally, if they all pass, a final job publishes the Docker image.