From 8f052de92b4d75fce66967458eb4872f261e50a4 Mon Sep 17 00:00:00 2001 From: jbrockmendel Date: Wed, 8 Dec 2021 05:54:36 -0800 Subject: [PATCH] CI: use pytest-timeout to avoid windows timeouts (#44814) --- .github/workflows/python-dev.yml | 2 +- azure-pipelines.yml | 2 +- ci/deps/actions-38-db-min.yaml | 1 + ci/deps/actions-38-db.yaml | 1 + ci/deps/actions-38-locale.yaml | 1 + ci/deps/actions-38-locale_slow.yaml | 1 + ci/deps/actions-38-minimum_versions.yaml | 1 + ci/deps/actions-38-slow.yaml | 1 + ci/deps/actions-38.yaml | 1 + ci/deps/actions-39-numpydev.yaml | 1 + ci/deps/actions-39-slow.yaml | 1 + ci/deps/actions-39.yaml | 1 + ci/deps/azure-macos-38.yaml | 1 + ci/deps/azure-windows-38.yaml | 1 + ci/deps/azure-windows-39.yaml | 1 + ci/deps/circle-38-arm64.yaml | 1 + environment.yml | 1 + pandas/tests/io/__init__.py | 2 ++ pandas/tests/io/test_user_agent.py | 4 ++++ requirements-dev.txt | 1 + 20 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-dev.yml b/.github/workflows/python-dev.yml index 8b3a5a23d7a97..2639aa26b6eed 100644 --- a/.github/workflows/python-dev.yml +++ b/.github/workflows/python-dev.yml @@ -51,7 +51,7 @@ jobs: python -m pip install --upgrade pip setuptools wheel pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy pip install git+https://github.com/nedbat/coveragepy.git - pip install cython python-dateutil pytz hypothesis pytest>=6.2.5 pytest-xdist pytest-cov + pip install cython python-dateutil pytz hypothesis pytest>=6.2.5 pytest-xdist pytest-cov pytest-timeout pip list - name: Build Pandas diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6c685d09ab55a..b716b46125410 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -43,7 +43,7 @@ jobs: /opt/python/cp38-cp38/bin/python -m venv ~/virtualenvs/pandas-dev && \ . ~/virtualenvs/pandas-dev/bin/activate && \ python -m pip install --no-deps -U pip wheel setuptools && \ - pip install cython numpy python-dateutil pytz pytest pytest-xdist hypothesis pytest-azurepipelines && \ + pip install cython numpy python-dateutil pytz pytest pytest-xdist hypothesis pytest-azurepipelines pytest-timeout && \ python setup.py build_ext -q -j2 && \ python -m pip install --no-build-isolation -e . && \ pytest -m 'not slow and not network and not clipboard' pandas --junitxml=test-data.xml" diff --git a/ci/deps/actions-38-db-min.yaml b/ci/deps/actions-38-db-min.yaml index f2b5a49ebfa97..27df541da1de4 100644 --- a/ci/deps/actions-38-db-min.yaml +++ b/ci/deps/actions-38-db-min.yaml @@ -9,6 +9,7 @@ dependencies: - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 + - pytest-timeout - hypothesis>=5.5.3 # required diff --git a/ci/deps/actions-38-db.yaml b/ci/deps/actions-38-db.yaml index 1a4e5d12f70df..aedf6f18816ca 100644 --- a/ci/deps/actions-38-db.yaml +++ b/ci/deps/actions-38-db.yaml @@ -8,6 +8,7 @@ dependencies: - cython>=0.29.24 - pytest>=6.0 - pytest-xdist>=1.31 + - pytest-timeout - hypothesis>=5.5.3 - pytest-cov>=2.10.1 # this is only needed in the coverage build, ref: GH 35737 diff --git a/ci/deps/actions-38-locale.yaml b/ci/deps/actions-38-locale.yaml index d401aa6434dd1..2e897bec10e2e 100644 --- a/ci/deps/actions-38-locale.yaml +++ b/ci/deps/actions-38-locale.yaml @@ -9,6 +9,7 @@ dependencies: - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 + - pytest-timeout - pytest-asyncio>=0.12.0 - hypothesis>=5.5.3 diff --git a/ci/deps/actions-38-locale_slow.yaml b/ci/deps/actions-38-locale_slow.yaml index e90acafa8bb2b..c90e14e76950b 100644 --- a/ci/deps/actions-38-locale_slow.yaml +++ b/ci/deps/actions-38-locale_slow.yaml @@ -10,6 +10,7 @@ dependencies: - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 + - pytest-timeout - hypothesis>=5.5.3 # pandas dependencies diff --git a/ci/deps/actions-38-minimum_versions.yaml b/ci/deps/actions-38-minimum_versions.yaml index cc1fd022ad24c..8a58c823864ad 100644 --- a/ci/deps/actions-38-minimum_versions.yaml +++ b/ci/deps/actions-38-minimum_versions.yaml @@ -9,6 +9,7 @@ dependencies: - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 + - pytest-timeout - hypothesis>=5.5.3 - psutil diff --git a/ci/deps/actions-38-slow.yaml b/ci/deps/actions-38-slow.yaml index cfafcd679e9b9..9b6f089cf79c0 100644 --- a/ci/deps/actions-38-slow.yaml +++ b/ci/deps/actions-38-slow.yaml @@ -9,6 +9,7 @@ dependencies: - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 + - pytest-timeout - hypothesis>=5.5.3 # pandas dependencies diff --git a/ci/deps/actions-38.yaml b/ci/deps/actions-38.yaml index 899913d6e8c70..c6df94c31bebf 100644 --- a/ci/deps/actions-38.yaml +++ b/ci/deps/actions-38.yaml @@ -10,6 +10,7 @@ dependencies: - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 + - pytest-timeout - hypothesis>=5.5.3 # pandas dependencies diff --git a/ci/deps/actions-39-numpydev.yaml b/ci/deps/actions-39-numpydev.yaml index 4a6acf55e265f..4b8c74d635323 100644 --- a/ci/deps/actions-39-numpydev.yaml +++ b/ci/deps/actions-39-numpydev.yaml @@ -8,6 +8,7 @@ dependencies: - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 + - pytest-timeout - hypothesis>=5.5.3 # pandas dependencies diff --git a/ci/deps/actions-39-slow.yaml b/ci/deps/actions-39-slow.yaml index cb54210e81f23..57de9ca0f348e 100644 --- a/ci/deps/actions-39-slow.yaml +++ b/ci/deps/actions-39-slow.yaml @@ -10,6 +10,7 @@ dependencies: - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 + - pytest-timeout - hypothesis>=5.5.3 # pandas dependencies diff --git a/ci/deps/actions-39.yaml b/ci/deps/actions-39.yaml index dc897453114f1..d2c961bc403de 100644 --- a/ci/deps/actions-39.yaml +++ b/ci/deps/actions-39.yaml @@ -9,6 +9,7 @@ dependencies: - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 + - pytest-timeout - hypothesis>=5.5.3 # pandas dependencies diff --git a/ci/deps/azure-macos-38.yaml b/ci/deps/azure-macos-38.yaml index fe6fa6ca37e01..e8e708b890821 100644 --- a/ci/deps/azure-macos-38.yaml +++ b/ci/deps/azure-macos-38.yaml @@ -8,6 +8,7 @@ dependencies: # tools - pytest>=6.0 - pytest-xdist>=1.31 + - pytest-timeout - hypothesis>=5.5.3 - pytest-azurepipelines diff --git a/ci/deps/azure-windows-38.yaml b/ci/deps/azure-windows-38.yaml index 9b68eb6f4c55b..c4180375a1e90 100644 --- a/ci/deps/azure-windows-38.yaml +++ b/ci/deps/azure-windows-38.yaml @@ -9,6 +9,7 @@ dependencies: - cython>=0.29.24 - pytest>=6.0 - pytest-xdist>=1.31 + - pytest-timeout - hypothesis>=5.5.3 - pytest-azurepipelines diff --git a/ci/deps/azure-windows-39.yaml b/ci/deps/azure-windows-39.yaml index a0dde78c37261..0ddfde9874069 100644 --- a/ci/deps/azure-windows-39.yaml +++ b/ci/deps/azure-windows-39.yaml @@ -9,6 +9,7 @@ dependencies: - cython>=0.29.24 - pytest>=6.0 - pytest-xdist>=1.31 + - pytest-timeout - hypothesis>=5.5.3 - pytest-azurepipelines diff --git a/ci/deps/circle-38-arm64.yaml b/ci/deps/circle-38-arm64.yaml index 6627ed5073b46..ac1120452d2bf 100644 --- a/ci/deps/circle-38-arm64.yaml +++ b/ci/deps/circle-38-arm64.yaml @@ -8,6 +8,7 @@ dependencies: - cython>=0.29.24 - pytest>=6.0 - pytest-xdist>=1.31 + - pytest-timeout - hypothesis>=5.5.3 # pandas dependencies diff --git a/environment.yml b/environment.yml index b4a8b977359cb..931464712f2cf 100644 --- a/environment.yml +++ b/environment.yml @@ -61,6 +61,7 @@ dependencies: - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 + - pytest-timeout - pytest-asyncio - pytest-instafail diff --git a/pandas/tests/io/__init__.py b/pandas/tests/io/__init__.py index 3231e38b985af..6ffafe0d61351 100644 --- a/pandas/tests/io/__init__.py +++ b/pandas/tests/io/__init__.py @@ -24,4 +24,6 @@ pytest.mark.filterwarnings( "ignore:As the xlwt package is no longer maintained:FutureWarning" ), + # Troubleshooting build failures that look like network timeouts + pytest.mark.timeout(60), ] diff --git a/pandas/tests/io/test_user_agent.py b/pandas/tests/io/test_user_agent.py index 1620b446800e0..e37ae58605698 100644 --- a/pandas/tests/io/test_user_agent.py +++ b/pandas/tests/io/test_user_agent.py @@ -13,6 +13,10 @@ import pandas as pd import pandas._testing as tm +# Troubleshooting build failures on Windows that tentatively look like +# they are stalling in this file. +pytestmark = pytest.mark.timeout(60) + class BaseUserAgentResponder(http.server.BaseHTTPRequestHandler): """ diff --git a/requirements-dev.txt b/requirements-dev.txt index 5673becbbe1cb..0753980a0069b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -39,6 +39,7 @@ flask pytest>=6.0 pytest-cov pytest-xdist>=1.31 +pytest-timeout pytest-asyncio pytest-instafail seaborn