Skip to content

Commit

Permalink
Skip timeout checks on slower running valgrind job
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Dec 31, 2022
1 parent 91b01f4 commit 2803304
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ jobs:
run: |
# The Pillow user in the docker container is UID 1000
sudo chown -R 1000 $GITHUB_WORKSPACE
docker run --name pillow_container -v $GITHUB_WORKSPACE:/Pillow pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }}
docker run --name pillow_container -e "PILLOW_VALGRIND_TEST=true" -v $GITHUB_WORKSPACE:/Pillow pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }}
sudo chown -R runner $GITHUB_WORKSPACE
1 change: 1 addition & 0 deletions Tests/test_file_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ def test_pdf_append_to_bytesio():


@pytest.mark.timeout(1)
@pytest.mark.skipif("PILLOW_VALGRIND_TEST" in os.environ, reason="Valgrind is slower")
@pytest.mark.parametrize("newline", (b"\r", b"\n"))
def test_redos(newline):
malicious = b" trailer<<>>" + newline * 3456
Expand Down
5 changes: 4 additions & 1 deletion Tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,11 @@ def test_check_size(self):
i = Image.new("RGB", [1, 1])
assert isinstance(i.size, tuple)

@pytest.mark.timeout(0.75)
@pytest.mark.skipif(
"PILLOW_VALGRIND_TEST" in os.environ, reason="Valgrind is slower"
)
@pytest.mark.parametrize("size", ((0, 100000000), (100000000, 0)))
@pytest.mark.timeout(0.5)
def test_empty_image(self, size):
Image.new("RGB", size)

Expand Down

0 comments on commit 2803304

Please sign in to comment.