From 731c9ea55ea9871ed38570ee891d074d9d416687 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Mon, 27 Nov 2017 14:46:10 -0800 Subject: [PATCH] Set timeouts on the tests that seem to be stalling on travis (but not elsewhere) --- test_requirements.txt | 3 ++- tests/test_main.py | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/test_requirements.txt b/test_requirements.txt index a978e1de..65df0707 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -1,4 +1,5 @@ pytest >= 3.2 pytest-helpers-namespace pytest-xdist -pytest-cov \ No newline at end of file +pytest-cov +pytest-timeout \ No newline at end of file diff --git a/tests/test_main.py b/tests/test_main.py index 1399f7a4..28b87098 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -1021,6 +1021,7 @@ def test_bad_locale(): assert 'configured to use ASCII as encoding' in err, "should whine" +@pytest.mark.timeout(30) def test_qpdf_negative_zero(resources, outpdf): negzero = resources / 'negzero.pdf' hugemono = resources / 'hugemono.pdf' @@ -1028,6 +1029,7 @@ def test_qpdf_negative_zero(resources, outpdf): qpdf.merge([str(negzero), str(hugemono)], outpdf, log=logging.getLogger()) +@pytest.mark.timeout(30) @pytest.mark.parametrize('max_files,skip', [ (2, 0), # Can we merge correctly without opening more than 2 files at once? (16, 0), # And does this work properly when we can one-shot it? @@ -1049,6 +1051,7 @@ def test_qpdf_merge_correctness(resources, outpdf, max_files, skip): assert len(PdfInfo(outpdf).pages) == len(input_files[skip:]) +@pytest.mark.timeout(30) @pytest.mark.skipif( True, reason='qpdf binary cannot open multiple files multiple times')