diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 68045bfc7c..73e644bcf1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -75,6 +75,12 @@ jobs: - name: Add test dependencies run: mamba env update --file ci/environment-test.yml + - name: Reconfigure pytest-timeout + shell: bash -l {0} + # No SIGALRM available on Windows + if: ${{ matrix.os == 'windows-latest' }} + run: sed -i.bak 's/timeout_method = signal/timeout_method = thread/' setup.cfg + - name: Dump environment run: | # For debugging diff --git a/ci/environment-test.yml b/ci/environment-test.yml index d7fd149d76..50b61778b5 100644 --- a/ci/environment-test.yml +++ b/ci/environment-test.yml @@ -7,6 +7,7 @@ dependencies: - jinja2 - packaging - pytest + - pytest-timeout - pytest-xdist - pyyaml - alembic diff --git a/setup.cfg b/setup.cfg index 1b0ff61db2..68b856b9d5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,3 +17,9 @@ profile = black addopts = -v -rsxfE --durations=0 --color=yes --strict-markers --strict-config markers = stability: marks stability tests +# pytest-timeout settings +# 'thread' kills off the whole test suite. 'signal' only kills the offending test. +# However, 'signal' doesn't work on Windows (due to lack of SIGALRM). +# The 'tests' CI script modifies this config file on the fly for Windows clients. +timeout_method = signal +timeout = 1200