Skip to content

Commit 09c72fa

Browse files
committed
Split slow valgrind tests in four batches
1 parent c1d3f7b commit 09c72fa

4 files changed

Lines changed: 13 additions & 6 deletions

File tree

.github/workflows/test-valgrind-memory.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ jobs:
4141
ubuntu-24.04-noble-amd64-valgrind,
4242
]
4343
dockerTag: [main]
44+
split: [1, 2, 3, 4]
4445

45-
name: ${{ matrix.docker }}
46+
name: ${{ matrix.docker }} ${{ matrix.split }}
4647

4748
steps:
4849
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
@@ -60,5 +61,5 @@ jobs:
6061
run: |
6162
# The Pillow user in the docker container is UID 1001
6263
sudo chown -R 1001 $GITHUB_WORKSPACE
63-
docker run --name pillow_container -e "PILLOW_VALGRIND_TEST=true" -v $GITHUB_WORKSPACE:/Pillow pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }} /Pillow/depends/docker-test-valgrind-memory.sh
64+
docker run --name pillow_container -e "PILLOW_VALGRIND_TEST=true" -e "SPLIT_COUNT=4" -e "SPLIT_INDEX=${{ matrix.split }}" -v $GITHUB_WORKSPACE:/Pillow pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }} /Pillow/depends/docker-test-valgrind-memory.sh
6465
sudo chown -R runner $GITHUB_WORKSPACE

.github/workflows/test-valgrind.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ jobs:
3535
ubuntu-24.04-noble-amd64-valgrind,
3636
]
3737
dockerTag: [main]
38+
split: [1, 2, 3, 4]
3839

39-
name: ${{ matrix.docker }}
40+
name: ${{ matrix.docker }} ${{ matrix.split }}
4041

4142
steps:
4243
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
@@ -54,5 +55,5 @@ jobs:
5455
run: |
5556
# The Pillow user in the docker container is UID 1001
5657
sudo chown -R 1001 $GITHUB_WORKSPACE
57-
docker run --name pillow_container -e "PILLOW_VALGRIND_TEST=true" -v $GITHUB_WORKSPACE:/Pillow pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }}
58+
docker run --name pillow_container -e "PILLOW_VALGRIND_TEST=true" -e "SPLIT_COUNT=4" -e "SPLIT_INDEX=${{ matrix.split }}" -v $GITHUB_WORKSPACE:/Pillow pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }}
5859
sudo chown -R runner $GITHUB_WORKSPACE

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ valgrind-leak:
114114
PILLOW_VALGRIND_TEST=true PYTHONMALLOC=malloc valgrind --suppressions=Tests/oss-fuzz/python.supp \
115115
--leak-check=full --show-leak-kinds=definite --errors-for-leak-kinds=definite \
116116
--log-file=/tmp/valgrind-output \
117-
python3 -m pytest -vv --valgrind --valgrind-log=/tmp/valgrind-output
117+
python3 -m pytest -vv --valgrind --valgrind-log=/tmp/valgrind-output $(PYTEST_ARGS)
118118

119119
.PHONY: readme
120120
readme:

depends/docker-test-valgrind-memory.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,9 @@ source /vpy3/bin/activate
88
cd /Pillow
99
make clean
1010
make install
11-
make valgrind-leak
11+
12+
SPLIT_ARGS=""
13+
if [ "${SPLIT_COUNT:-1}" -gt 1 ]; then
14+
SPLIT_ARGS="--splits ${SPLIT_COUNT} --group ${SPLIT_INDEX} --durations-path /depends/.test_durations"
15+
fi
16+
make valgrind-leak PYTEST_ARGS="$SPLIT_ARGS"

0 commit comments

Comments
 (0)