From 831324ed0ca99ec9ef0028815bf835c113008ff8 Mon Sep 17 00:00:00 2001 From: Brock Date: Tue, 27 Oct 2020 16:05:38 -0700 Subject: [PATCH 1/4] CI: Troubleshoot PY38 windows build --- ci/azure/windows.yml | 2 +- ci/run_tests.sh | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ci/azure/windows.yml b/ci/azure/windows.yml index 5938ba1fd69f5..c931f7cdc7867 100644 --- a/ci/azure/windows.yml +++ b/ci/azure/windows.yml @@ -16,7 +16,7 @@ jobs: py38_np18: ENV_FILE: ci/deps/azure-windows-38.yaml CONDA_PY: "38" - PATTERN: "not slow and not network" + PATTERN: "not slow and not network and not db and not high_memory" steps: - powershell: | diff --git a/ci/run_tests.sh b/ci/run_tests.sh index fda2005ce7843..b6a14341c1813 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -20,7 +20,16 @@ if [[ $(uname) == "Linux" && -z $DISPLAY ]]; then XVFB="xvfb-run " fi -PYTEST_CMD="${XVFB}pytest -m \"$PATTERN\" -n $PYTEST_WORKERS --dist=loadfile -s --strict --durations=30 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas" +if [[ $(uname) == "Linux" ]]; then + PYTEST_CMD="${XVFB}pytest -m \"$PATTERN\" -n $PYTEST_WORKERS --dist=loadfile -s --strict --durations=30 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas" +elif [[ $(uname) == 'Darwin' ]]; then + PYTEST_CMD="${XVFB}pytest -m \"$PATTERN\" -n $PYTEST_WORKERS --dist=loadfile -s --strict --durations=30 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas" +else + # Windows, see if running only a subset of tests will help with py38 + # build failures + PYTEST_CMD="${XVFB}pytest -m \"$PATTERN\" -n $PYTEST_WORKERS --dist=loadfile -s --strict --durations=30 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas/tests/api pandas/tests/arithmetic pandas/tests/base pandas/tests/config pandas/tests/dtypes pandas/tests/extension pandas/tests/frame pandas/tests/generic pandas/tests/indexes pandas/tests/indexing pandas/tests/internals pandas/tests/reductions pandas/tests/reshape pandas/tests/scalar pandas/tests/series pandas/tests/tools pandas/tests/tseries pandas/tests/tslibs pandas/tests/util" +fi + echo $PYTEST_CMD sh -c "$PYTEST_CMD" From 78d7067c08f46ccd9d638481084b7c76da14e6d7 Mon Sep 17 00:00:00 2001 From: Brock Date: Tue, 27 Oct 2020 18:21:33 -0700 Subject: [PATCH 2/4] use catch_warnings --- pandas/tests/frame/test_api.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pandas/tests/frame/test_api.py b/pandas/tests/frame/test_api.py index 34d56672e5536..b6dde90ce161f 100644 --- a/pandas/tests/frame/test_api.py +++ b/pandas/tests/frame/test_api.py @@ -2,6 +2,7 @@ import datetime import inspect import pydoc +import warnings import numpy as np import pytest @@ -561,9 +562,13 @@ def test_constructor_expanddim_lookup(self): # raise NotImplementedError df = DataFrame() - with tm.assert_produces_warning(FutureWarning, check_stacklevel=False): + with warnings.catch_warnings(record=True) as wrn: # _AXIS_NUMBERS, _AXIS_NAMES lookups inspect.getmembers(df) + # some versions give FutureWarning, others DeprecationWarning + assert len(wrn) + assert any(x.category in [FutureWarning, DeprecationWarning] for x in wrn) + with pytest.raises(NotImplementedError, match="Not supported for DataFrames!"): df._constructor_expanddim(np.arange(27).reshape(3, 3, 3)) From cfed04cce2644cc9baa230cf33d17d0eb075938e Mon Sep 17 00:00:00 2001 From: Brock Date: Fri, 30 Oct 2020 17:30:57 -0700 Subject: [PATCH 3/4] try using --ignore --- ci/azure/windows.yml | 2 +- ci/run_tests.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/azure/windows.yml b/ci/azure/windows.yml index c931f7cdc7867..601a834d6306a 100644 --- a/ci/azure/windows.yml +++ b/ci/azure/windows.yml @@ -16,7 +16,7 @@ jobs: py38_np18: ENV_FILE: ci/deps/azure-windows-38.yaml CONDA_PY: "38" - PATTERN: "not slow and not network and not db and not high_memory" + PATTERN: "not slow and not network and not high_memory" steps: - powershell: | diff --git a/ci/run_tests.sh b/ci/run_tests.sh index b6a14341c1813..34093c8d59f90 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -27,7 +27,7 @@ elif [[ $(uname) == 'Darwin' ]]; then else # Windows, see if running only a subset of tests will help with py38 # build failures - PYTEST_CMD="${XVFB}pytest -m \"$PATTERN\" -n $PYTEST_WORKERS --dist=loadfile -s --strict --durations=30 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas/tests/api pandas/tests/arithmetic pandas/tests/base pandas/tests/config pandas/tests/dtypes pandas/tests/extension pandas/tests/frame pandas/tests/generic pandas/tests/indexes pandas/tests/indexing pandas/tests/internals pandas/tests/reductions pandas/tests/reshape pandas/tests/scalar pandas/tests/series pandas/tests/tools pandas/tests/tseries pandas/tests/tslibs pandas/tests/util" + PYTEST_CMD="${XVFB}pytest -m \"$PATTERN\" -n $PYTEST_WORKERS --dist=loadfile -s --strict --durations=30 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas/tests --ignore=pandas/tests/window/" fi From abc0a9e1cf6e04656f80d818175a44d4f42e2d09 Mon Sep 17 00:00:00 2001 From: Brock Date: Fri, 30 Oct 2020 19:00:30 -0700 Subject: [PATCH 4/4] CLN: run_tests.sh --- ci/run_tests.sh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/ci/run_tests.sh b/ci/run_tests.sh index 34093c8d59f90..9b553fbc81a03 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -20,16 +20,13 @@ if [[ $(uname) == "Linux" && -z $DISPLAY ]]; then XVFB="xvfb-run " fi -if [[ $(uname) == "Linux" ]]; then - PYTEST_CMD="${XVFB}pytest -m \"$PATTERN\" -n $PYTEST_WORKERS --dist=loadfile -s --strict --durations=30 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas" -elif [[ $(uname) == 'Darwin' ]]; then - PYTEST_CMD="${XVFB}pytest -m \"$PATTERN\" -n $PYTEST_WORKERS --dist=loadfile -s --strict --durations=30 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas" -else - # Windows, see if running only a subset of tests will help with py38 - # build failures - PYTEST_CMD="${XVFB}pytest -m \"$PATTERN\" -n $PYTEST_WORKERS --dist=loadfile -s --strict --durations=30 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas/tests --ignore=pandas/tests/window/" -fi +PYTEST_CMD="${XVFB}pytest -m \"$PATTERN\" -n $PYTEST_WORKERS --dist=loadfile -s --strict --durations=30 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas" +if [[ $(uname) != "Linux" && $(uname) != "Darwin" ]]; then + # GH#37455 windows py38 build appears to be running out of memory + # skip collection of window tests + PYTEST_CMD="$PYTEST_CMD --ignore=pandas/tests/window/" +fi echo $PYTEST_CMD sh -c "$PYTEST_CMD"