Skip to content

Commit 635b9d0

Browse files
authored
add timeouts for tests (#7657)
* install `pytest-timeout` into all environments * don't also install it into the upstream-dev environment * set a timeout of 5 minutes This is plenty for a test to run: we shouldn't have tests that take more than 30 seconds, but the windows / macos runners tend to be slower than the linux ones. * add `pytest-timeout` to the remaining test environments * add `pytest-timeout` to the ignored dependencies [skip-rtd] * reduce the timeout from 5 minutes to 90 seconds * double the test timeout
1 parent 6364cc0 commit 635b9d0

10 files changed

+9
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ jobs:
125125
126126
- name: Run tests
127127
run: python -m pytest -n 4
128+
--timeout 180
128129
--cov=xarray
129130
--cov-report=xml
130131
--junitxml=pytest.xml

ci/install-upstream-wheels.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,3 @@ python -m pip install \
4848
git+https://github.com/SciTools/nc-time-axis \
4949
git+https://github.com/xarray-contrib/flox \
5050
git+https://github.com/h5netcdf/h5netcdf
51-
python -m pip install pytest-timeout

ci/min_deps_check.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"pytest-cov",
2727
"pytest-env",
2828
"pytest-xdist",
29+
"pytest-timeout",
2930
}
3031

3132
POLICY_MONTHS = {"python": 24, "numpy": 18}

ci/requirements/all-but-dask.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ dependencies:
3535
- pytest-cov
3636
- pytest-env
3737
- pytest-xdist
38+
- pytest-timeout
3839
- rasterio
3940
- scipy
4041
- seaborn

ci/requirements/bare-minimum.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ dependencies:
1010
- pytest-cov
1111
- pytest-env
1212
- pytest-xdist
13+
- pytest-timeout
1314
- numpy=1.21
1415
- packaging=21.3
1516
- pandas=1.4

ci/requirements/environment-py311.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ dependencies:
3939
- pytest-cov
4040
- pytest-env
4141
- pytest-xdist
42+
- pytest-timeout
4243
- rasterio
4344
- scipy
4445
- seaborn

ci/requirements/environment-windows-py311.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ dependencies:
3535
- pytest-cov
3636
- pytest-env
3737
- pytest-xdist
38+
- pytest-timeout
3839
- rasterio
3940
- scipy
4041
- seaborn

ci/requirements/environment-windows.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ dependencies:
3535
- pytest-cov
3636
- pytest-env
3737
- pytest-xdist
38+
- pytest-timeout
3839
- rasterio
3940
- scipy
4041
- seaborn

ci/requirements/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ dependencies:
3939
- pytest-cov
4040
- pytest-env
4141
- pytest-xdist
42+
- pytest-timeout
4243
- rasterio
4344
- scipy
4445
- seaborn

ci/requirements/min-all-deps.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ dependencies:
4444
- pytest-cov
4545
- pytest-env
4646
- pytest-xdist
47+
- pytest-timeout
4748
- rasterio=1.2
4849
- scipy=1.7
4950
- seaborn=0.11

0 commit comments

Comments
 (0)