From 70d435c3e107ba9ae0418b082630cea77db0947e Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Wed, 22 Mar 2023 11:08:59 +0100 Subject: [PATCH 1/7] install `pytest-timeout` into all environments --- ci/requirements/environment-py311.yml | 1 + ci/requirements/environment-windows-py311.yml | 1 + ci/requirements/environment-windows.yml | 1 + ci/requirements/environment.yml | 1 + 4 files changed, 4 insertions(+) diff --git a/ci/requirements/environment-py311.yml b/ci/requirements/environment-py311.yml index e23fa44c683..7f6b012634c 100644 --- a/ci/requirements/environment-py311.yml +++ b/ci/requirements/environment-py311.yml @@ -39,6 +39,7 @@ dependencies: - pytest-cov - pytest-env - pytest-xdist + - pytest-timeout - rasterio - scipy - seaborn diff --git a/ci/requirements/environment-windows-py311.yml b/ci/requirements/environment-windows-py311.yml index 3fc207dc609..8b916b5626c 100644 --- a/ci/requirements/environment-windows-py311.yml +++ b/ci/requirements/environment-windows-py311.yml @@ -35,6 +35,7 @@ dependencies: - pytest-cov - pytest-env - pytest-xdist + - pytest-timeout - rasterio - scipy - seaborn diff --git a/ci/requirements/environment-windows.yml b/ci/requirements/environment-windows.yml index 0941af474f7..d86d9825fef 100644 --- a/ci/requirements/environment-windows.yml +++ b/ci/requirements/environment-windows.yml @@ -35,6 +35,7 @@ dependencies: - pytest-cov - pytest-env - pytest-xdist + - pytest-timeout - rasterio - scipy - seaborn diff --git a/ci/requirements/environment.yml b/ci/requirements/environment.yml index e87e69138ee..4d3a5404878 100644 --- a/ci/requirements/environment.yml +++ b/ci/requirements/environment.yml @@ -39,6 +39,7 @@ dependencies: - pytest-cov - pytest-env - pytest-xdist + - pytest-timeout - rasterio - scipy - seaborn From d66b394c1c7b17cfd7b5a0530c6a9d2be80e7815 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Wed, 22 Mar 2023 11:09:32 +0100 Subject: [PATCH 2/7] don't also install it into the upstream-dev environment --- ci/install-upstream-wheels.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/install-upstream-wheels.sh b/ci/install-upstream-wheels.sh index 62bf08b366f..171ba3bf55f 100755 --- a/ci/install-upstream-wheels.sh +++ b/ci/install-upstream-wheels.sh @@ -48,4 +48,3 @@ python -m pip install \ git+https://github.com/SciTools/nc-time-axis \ git+https://github.com/xarray-contrib/flox \ git+https://github.com/h5netcdf/h5netcdf -python -m pip install pytest-timeout From 0fd818f7189765950e1c8045790329a34b762e18 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Wed, 22 Mar 2023 11:10:15 +0100 Subject: [PATCH 3/7] 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. --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c4881bc4871..bae7fc012ce 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -125,6 +125,7 @@ jobs: - name: Run tests run: python -m pytest -n 4 + --timeout 300 --cov=xarray --cov-report=xml --junitxml=pytest.xml From 287ed5ad928fbc189e74992458948ad40ea6e957 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Wed, 22 Mar 2023 11:23:57 +0100 Subject: [PATCH 4/7] add `pytest-timeout` to the remaining test environments --- ci/requirements/all-but-dask.yml | 1 + ci/requirements/bare-minimum.yml | 1 + ci/requirements/min-all-deps.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/ci/requirements/all-but-dask.yml b/ci/requirements/all-but-dask.yml index ce819640c76..549b0a33a91 100644 --- a/ci/requirements/all-but-dask.yml +++ b/ci/requirements/all-but-dask.yml @@ -35,6 +35,7 @@ dependencies: - pytest-cov - pytest-env - pytest-xdist + - pytest-timeout - rasterio - scipy - seaborn diff --git a/ci/requirements/bare-minimum.yml b/ci/requirements/bare-minimum.yml index e8d05180966..0a36493fa07 100644 --- a/ci/requirements/bare-minimum.yml +++ b/ci/requirements/bare-minimum.yml @@ -10,6 +10,7 @@ dependencies: - pytest-cov - pytest-env - pytest-xdist + - pytest-timeout - numpy=1.21 - packaging=21.3 - pandas=1.4 diff --git a/ci/requirements/min-all-deps.yml b/ci/requirements/min-all-deps.yml index 4df2a3d7b19..036a159675e 100644 --- a/ci/requirements/min-all-deps.yml +++ b/ci/requirements/min-all-deps.yml @@ -44,6 +44,7 @@ dependencies: - pytest-cov - pytest-env - pytest-xdist + - pytest-timeout - rasterio=1.2 - scipy=1.7 - seaborn=0.11 From fdae8a8deea0f8df66816d05d75b302cfcc91853 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Wed, 22 Mar 2023 11:29:36 +0100 Subject: [PATCH 5/7] add `pytest-timeout` to the ignored dependencies [skip-rtd] --- ci/min_deps_check.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/min_deps_check.py b/ci/min_deps_check.py index 3bff655de0a..9631cb03162 100755 --- a/ci/min_deps_check.py +++ b/ci/min_deps_check.py @@ -26,6 +26,7 @@ "pytest-cov", "pytest-env", "pytest-xdist", + "pytest-timeout", } POLICY_MONTHS = {"python": 24, "numpy": 18} From 55113747a441209fae49bf42c092e4ba582ca294 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Wed, 22 Mar 2023 14:13:09 +0100 Subject: [PATCH 6/7] reduce the timeout from 5 minutes to 90 seconds --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bae7fc012ce..51cc1d28221 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -125,7 +125,7 @@ jobs: - name: Run tests run: python -m pytest -n 4 - --timeout 300 + --timeout 90 --cov=xarray --cov-report=xml --junitxml=pytest.xml From d281fecbc2b7ca42358abc33f06ed9373e1ca4e1 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Thu, 23 Mar 2023 11:02:43 +0100 Subject: [PATCH 7/7] double the test timeout --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 51cc1d28221..acace7aab95 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -125,7 +125,7 @@ jobs: - name: Run tests run: python -m pytest -n 4 - --timeout 90 + --timeout 180 --cov=xarray --cov-report=xml --junitxml=pytest.xml