Skip to content

CI: debug azure timeouts #43611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 13 commits into from
2 changes: 1 addition & 1 deletion .github/workflows/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
uses: ./.github/actions/build_pandas

- name: Test
run: pytest -m "${{ env.PATTERN }}" -n 2 --dist=loadfile --cov=pandas --cov-report=xml pandas/tests/io
run: pytest -m "${{ env.PATTERN }}" -n 2 --dist=loadfile --cov=pandas --cov-report=xml pandas/tests/io --timeout=300
if: always()

- name: Build Version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy
pip install git+https://github.com/pytest-dev/pytest.git
pip install git+https://github.com/nedbat/coveragepy.git
pip install cython python-dateutil pytz hypothesis pytest-xdist pytest-cov
pip install cython python-dateutil pytz hypothesis pytest-xdist pytest-cov pytest-timeout
pip list

- name: Build Pandas
Expand Down
4 changes: 2 additions & 2 deletions ci/azure/posix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
py38_macos_1:
ENV_FILE: ci/deps/azure-macos-38.yaml
CONDA_PY: "38"
PATTERN: "not slow and not network"
PATTERN: "not slow and not network and not single"
PYTEST_TARGET: "pandas/tests/[a-h]*"
py38_macos_2:
ENV_FILE: ci/deps/azure-macos-38.yaml
CONDA_PY: "38"
PATTERN: "not slow and not network"
PATTERN: "not slow and not network and not single"
PYTEST_TARGET: "pandas/tests/[i-z]*"

steps:
Expand Down
2 changes: 2 additions & 0 deletions ci/deps/actions-38-db-min.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ dependencies:
- psycopg2=2.8.4
- pymysql=0.10.1
- sqlalchemy=1.3.11
- pip:
- pytest-timeout
1 change: 1 addition & 0 deletions ci/deps/actions-38-db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ dependencies:
- coverage
- pandas-datareader
- pyxlsb
- pytest-timeout
1 change: 1 addition & 0 deletions ci/deps/actions-38-locale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ dependencies:
- pip
- pip:
- pyxlsb
- pytest-timeout
2 changes: 2 additions & 0 deletions ci/deps/actions-38-locale_slow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ dependencies:
- xlsxwriter=1.2.2
- xlwt=1.3.0
- html5lib=1.1
- pip:
- pytest-timeout
2 changes: 2 additions & 0 deletions ci/deps/actions-38-minimum_versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ dependencies:
- xlsxwriter=1.2.2
- xlwt=1.3.0
- html5lib=1.1
- pip:
- pytest-timeout
2 changes: 2 additions & 0 deletions ci/deps/actions-38-slow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ dependencies:
- moto
- flask
- numba
- pip:
- pytest-timeout
2 changes: 2 additions & 0 deletions ci/deps/actions-38.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ dependencies:
- nomkl
- pytz
- tabulate==0.8.7
- pip:
- pytest-timeout
1 change: 1 addition & 0 deletions ci/deps/actions-39-numpydev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ dependencies:
- "--pre"
- "numpy"
- "scipy"
- pytest-timeout
1 change: 1 addition & 0 deletions ci/deps/actions-39-slow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ dependencies:
- pip
- pip:
- pyxlsb
- pytest-timeout
1 change: 1 addition & 0 deletions ci/deps/actions-39.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ dependencies:
- pip
- pip:
- pyxlsb
- pytest-timeout
1 change: 1 addition & 0 deletions ci/deps/azure-macos-38.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ dependencies:
- cython>=0.29.21
- pyreadstat
- pyxlsb
- pytest-timeout
2 changes: 2 additions & 0 deletions ci/deps/azure-windows-38.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ dependencies:
- xlrd
- xlsxwriter
- xlwt
- pip:
- pytest-timeout
1 change: 1 addition & 0 deletions ci/deps/azure-windows-39.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ dependencies:
- pip
- pip:
- pyxlsb
- pytest-timeout
2 changes: 1 addition & 1 deletion ci/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [[ $(uname) == "Linux" && -z $DISPLAY ]]; then
XVFB="xvfb-run "
fi

PYTEST_CMD="${XVFB}pytest -m \"$PATTERN\" -n $PYTEST_WORKERS --dist=loadfile $TEST_ARGS $COVERAGE $PYTEST_TARGET"
PYTEST_CMD="${XVFB}pytest -m \"$PATTERN\" -n $PYTEST_WORKERS --dist=loadfile $TEST_ARGS $COVERAGE $PYTEST_TARGET --timeout=60"

if [[ $(uname) != "Linux" && $(uname) != "Darwin" ]]; then
# GH#37455 windows py38 build appears to be running out of memory
Expand Down
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ dependencies:
- pytest-xdist>=1.31
- pytest-asyncio
- pytest-instafail
- pytest-timeout

# downstream tests
- seaborn
Expand Down
5 changes: 3 additions & 2 deletions pandas/tests/io/parser/common/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import pandas._testing as tm

xfail_pyarrow = pytest.mark.usefixtures("pyarrow_xfail")
skip_pyarrow = pytest.mark.usefixtures("pyarrow_skip")


@pytest.mark.parametrize(
Expand Down Expand Up @@ -271,7 +272,7 @@ def test_empty_with_index(all_parsers):
tm.assert_frame_equal(result, expected)


@xfail_pyarrow
@skip_pyarrow
def test_empty_with_multi_index(all_parsers):
# see gh-10467
data = "x,y,z"
Expand All @@ -284,7 +285,7 @@ def test_empty_with_multi_index(all_parsers):
tm.assert_frame_equal(result, expected)


@xfail_pyarrow
@skip_pyarrow
def test_empty_with_reversed_multi_index(all_parsers):
data = "x,y,z"
parser = all_parsers
Expand Down
9 changes: 4 additions & 5 deletions pandas/tests/io/parser/common/test_ints.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
)
import pandas._testing as tm

xfail_pyarrow = pytest.mark.usefixtures("pyarrow_xfail")
skip_pyarrow = pytest.mark.usefixtures("pyarrow_skip")


Expand Down Expand Up @@ -119,7 +118,7 @@ def test_int64_min_issues(all_parsers):
tm.assert_frame_equal(result, expected)


@xfail_pyarrow
@skip_pyarrow
@pytest.mark.parametrize("conv", [None, np.int64, np.uint64])
def test_int64_overflow(all_parsers, conv):
data = """ID
Expand Down Expand Up @@ -163,7 +162,7 @@ def test_int64_overflow(all_parsers, conv):
parser.read_csv(StringIO(data), converters={"ID": conv})


@xfail_pyarrow
@skip_pyarrow
@pytest.mark.parametrize(
"val", [np.iinfo(np.uint64).max, np.iinfo(np.int64).max, np.iinfo(np.int64).min]
)
Expand All @@ -177,7 +176,7 @@ def test_int64_uint64_range(all_parsers, val):
tm.assert_frame_equal(result, expected)


@xfail_pyarrow
@skip_pyarrow
@pytest.mark.parametrize(
"val", [np.iinfo(np.uint64).max + 1, np.iinfo(np.int64).min - 1]
)
Expand All @@ -191,7 +190,7 @@ def test_outside_int64_uint64_range(all_parsers, val):
tm.assert_frame_equal(result, expected)


@xfail_pyarrow
@skip_pyarrow
@pytest.mark.parametrize("exp_data", [[str(-1), str(2 ** 63)], [str(2 ** 63), str(-1)]])
def test_numeric_range_too_wide(all_parsers, exp_data):
# No numerical dtype can hold both negative and uint64
Expand Down
21 changes: 11 additions & 10 deletions pandas/tests/io/parser/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ def csv1(datapath):
return os.path.join(datapath("io", "data", "csv"), "test1.csv")


_cParserHighMemory = CParserHighMemory()
_cParserLowMemory = CParserLowMemory()
_pythonParser = PythonParser()
_pyarrowParser = PyArrowParser()
_cParserHighMemory = CParserHighMemory
_cParserLowMemory = CParserLowMemory
_pythonParser = PythonParser
_pyarrowParser = PyArrowParser

_py_parsers_only = [_pythonParser]
_c_parsers_only = [_cParserHighMemory, _cParserLowMemory]
Expand All @@ -105,37 +105,38 @@ def all_parsers(request):
"""
Fixture all of the CSV parsers.
"""
if request.param.engine == "pyarrow":
parser = request.param()
if parser.engine == "pyarrow":
pytest.importorskip("pyarrow", VERSIONS["pyarrow"])
# Try setting num cpus to 1 to avoid hangs?
import pyarrow

pyarrow.set_cpu_count(1)
return request.param
return parser


@pytest.fixture(params=_c_parsers_only, ids=_c_parser_ids)
def c_parser_only(request):
"""
Fixture all of the CSV parsers using the C engine.
"""
return request.param
return request.param()


@pytest.fixture(params=_py_parsers_only, ids=_py_parser_ids)
def python_parser_only(request):
"""
Fixture all of the CSV parsers using the Python engine.
"""
return request.param
return request.param()


@pytest.fixture(params=_pyarrow_parsers_only, ids=_pyarrow_parsers_ids)
def pyarrow_parser_only(request):
"""
Fixture all of the CSV parsers using the Pyarrow engine.
"""
return request.param
return request.param()


def _get_all_parser_float_precision_combinations():
Expand All @@ -147,7 +148,7 @@ def _get_all_parser_float_precision_combinations():
ids = []
for parser, parser_id in zip(_all_parsers, _all_parser_ids):
for precision in parser.float_precision_choices:
params.append((parser, precision))
params.append((parser(), precision))
ids.append(f"{parser_id}-{precision}")

return {"params": params, "ids": ids}
Expand Down
15 changes: 9 additions & 6 deletions pandas/tests/io/parser/test_parse_dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
from pandas.io.parsers import read_csv

xfail_pyarrow = pytest.mark.usefixtures("pyarrow_xfail")
skip_pyarrow = pytest.mark.usefixtures("pyarrow_skip")

# constant
_DEFAULT_DATETIME = datetime(1, 1, 1)
Expand Down Expand Up @@ -1573,7 +1574,7 @@ def test_parse_timezone(all_parsers):
tm.assert_frame_equal(result, expected)


@xfail_pyarrow
@skip_pyarrow
@pytest.mark.parametrize(
"date_string",
["32/32/2019", "02/30/2019", "13/13/2019", "13/2019", "a3/11/2018", "10/11/2o17"],
Expand All @@ -1585,7 +1586,7 @@ def test_invalid_parse_delimited_date(all_parsers, date_string):
tm.assert_frame_equal(result, expected)


@xfail_pyarrow
@skip_pyarrow
@pytest.mark.parametrize(
"date_string,dayfirst,expected",
[
Expand All @@ -1608,7 +1609,7 @@ def test_parse_delimited_date_swap_no_warning(
tm.assert_frame_equal(result, expected)


@xfail_pyarrow
@skip_pyarrow
@pytest.mark.parametrize(
"date_string,dayfirst,expected",
[
Expand Down Expand Up @@ -1643,6 +1644,8 @@ def _helper_hypothesis_delimited_date(call, date_string, **kwargs):
return msg, result


@pytest.mark.slow
@skip_pyarrow
@given(date_strategy)
@settings(deadline=None)
@pytest.mark.parametrize("delimiter", list(" -./"))
Expand Down Expand Up @@ -1678,7 +1681,7 @@ def test_hypothesis_delimited_date(date_format, dayfirst, delimiter, test_dateti
assert result == expected


@xfail_pyarrow
@skip_pyarrow
@pytest.mark.parametrize(
"names, usecols, parse_dates, missing_cols",
[
Expand Down Expand Up @@ -1711,7 +1714,7 @@ def test_missing_parse_dates_column_raises(
)


@xfail_pyarrow
@skip_pyarrow
def test_date_parser_and_names(all_parsers):
# GH#33699
parser = all_parsers
Expand All @@ -1721,7 +1724,7 @@ def test_date_parser_and_names(all_parsers):
tm.assert_frame_equal(result, expected)


@xfail_pyarrow
@skip_pyarrow
def test_date_parser_usecols_thousands(all_parsers):
# GH#39365
data = """A,B,C
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ markers = [
"arm_slow: mark a test as slow for arm64 architecture",
"arraymanager: mark a test to run with ArrayManager enabled",
]
log_cli = 1

[tool.mypy]
platform = "linux-64"
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ pytest-cov
pytest-xdist>=1.31
pytest-asyncio
pytest-instafail
pytest-timeout
seaborn
statsmodels
ipywidgets
Expand Down