Skip to content

TST: Disable testing that hangs Azure CI #45702

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

Merged
merged 5 commits into from
Jan 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pandas/tests/io/excel/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest

from pandas.compat import is_platform_windows
import pandas.util._test_decorators as td

import pandas._testing as tm
Expand Down Expand Up @@ -43,7 +44,8 @@ def read_ext(request):
return request.param


@pytest.fixture(autouse=True)
# Checking for file leaks can hang on Windows CI
@pytest.fixture(autouse=not is_platform_windows())
def check_for_file_leaks():
"""
Fixture to run around every test to ensure that we are not leaking files.
Expand Down
6 changes: 2 additions & 4 deletions pandas/tests/io/excel/test_readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,7 @@ def parser(self, *args, **kwargs):
expected = expected_defaults[read_ext[1:]]
assert result == expected

def test_usecols_int(self, read_ext, df_ref):
df_ref = df_ref.reindex(columns=["A", "B", "C"])

def test_usecols_int(self, read_ext):
# usecols as int
msg = "Passing an integer for `usecols`"
with pytest.raises(ValueError, match=msg):
Expand Down Expand Up @@ -1311,7 +1309,7 @@ def cd_and_set_engine(self, engine, datapath, monkeypatch):
monkeypatch.chdir(datapath("io", "data", "excel"))
monkeypatch.setattr(pd, "ExcelFile", func)

def test_engine_used(self, read_ext, engine, monkeypatch):
def test_engine_used(self, read_ext, engine):
expected_defaults = {
"xlsx": "openpyxl",
"xlsm": "openpyxl",
Expand Down
4 changes: 3 additions & 1 deletion pandas/tests/io/parser/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ def all_parsers(request):
parser = request.param()
if parser.engine == "pyarrow":
pytest.importorskip("pyarrow", VERSIONS["pyarrow"])
# Try setting num cpus to 1 to avoid hangs?
# Try setting num cpus to 1 to avoid hangs on Azure MacOS/Windows builds
# or better yet find a way to disable threads
# TODO(GH#44584) pytest.mark.single these tests
import pyarrow

pyarrow.set_cpu_count(1)
Expand Down
8 changes: 8 additions & 0 deletions pandas/tests/io/test_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ def sqlite_buildin_iris(sqlite_buildin, iris_path):
all_connectable_iris = sqlalchemy_connectable_iris + ["sqlite_buildin_iris"]


@pytest.mark.db
@pytest.mark.parametrize("conn", all_connectable)
@pytest.mark.parametrize("method", [None, "multi"])
def test_to_sql(conn, method, test_frame1, request):
Expand All @@ -508,6 +509,7 @@ def test_to_sql(conn, method, test_frame1, request):
assert count_rows(conn, "test_frame") == len(test_frame1)


@pytest.mark.db
@pytest.mark.parametrize("conn", all_connectable)
@pytest.mark.parametrize("mode, num_row_coef", [("replace", 1), ("append", 2)])
def test_to_sql_exist(conn, mode, num_row_coef, test_frame1, request):
Expand All @@ -519,6 +521,7 @@ def test_to_sql_exist(conn, mode, num_row_coef, test_frame1, request):
assert count_rows(conn, "test_frame") == num_row_coef * len(test_frame1)


@pytest.mark.db
@pytest.mark.parametrize("conn", all_connectable)
def test_to_sql_exist_fail(conn, test_frame1, request):
conn = request.getfixturevalue(conn)
Expand All @@ -531,6 +534,7 @@ def test_to_sql_exist_fail(conn, test_frame1, request):
pandasSQL.to_sql(test_frame1, "test_frame", if_exists="fail")


@pytest.mark.db
@pytest.mark.parametrize("conn", all_connectable_iris)
def test_read_iris(conn, request):
conn = request.getfixturevalue(conn)
Expand All @@ -539,6 +543,7 @@ def test_read_iris(conn, request):
check_iris_frame(iris_frame)


@pytest.mark.db
@pytest.mark.parametrize("conn", sqlalchemy_connectable)
def test_to_sql_callable(conn, test_frame1, request):
conn = request.getfixturevalue(conn)
Expand All @@ -557,6 +562,7 @@ def sample(pd_table, conn, keys, data_iter):
assert count_rows(conn, "test_frame") == len(test_frame1)


@pytest.mark.db
@pytest.mark.parametrize("conn", mysql_connectable)
def test_default_type_conversion(conn, request):
conn = request.getfixturevalue(conn)
Expand All @@ -575,6 +581,7 @@ def test_default_type_conversion(conn, request):
assert issubclass(df.BoolColWithNull.dtype.type, np.floating)


@pytest.mark.db
@pytest.mark.parametrize("conn", mysql_connectable)
def test_read_procedure(conn, request):
conn = request.getfixturevalue(conn)
Expand Down Expand Up @@ -611,6 +618,7 @@ def test_read_procedure(conn, request):
tm.assert_frame_equal(df, res2)


@pytest.mark.db
@pytest.mark.parametrize("conn", postgresql_connectable)
def test_copy_from_callable_insertion_method(conn, request):
# GH 8953
Expand Down
15 changes: 15 additions & 0 deletions pandas/tests/window/test_numba.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import os

import numpy as np
import pytest

from pandas.compat import (
is_platform_mac,
is_platform_windows,
)
from pandas.errors import NumbaUtilError
import pandas.util._test_decorators as td

Expand All @@ -13,6 +19,15 @@
import pandas._testing as tm
from pandas.core.util.numba_ import NUMBA_FUNC_CACHE

# TODO(GH#44584): Mark these as pytest.mark.single
pytestmark = pytest.mark.skipif(
os.environ.get("PANDAS_CI", "0") == "1"
and (is_platform_windows() or is_platform_mac()),
reason="On Azure CI, Windows can fail with "
"'Windows fatal exception: stack overflow' "
"and MacOS can timeout",
)


@pytest.fixture(params=["single", "table"])
def method(request):
Expand Down
15 changes: 15 additions & 0 deletions pandas/tests/window/test_online.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import os

import numpy as np
import pytest

from pandas.compat import (
is_platform_mac,
is_platform_windows,
)
import pandas.util._test_decorators as td

from pandas import (
Expand All @@ -9,6 +15,15 @@
)
import pandas._testing as tm

# TODO(GH#44584): Mark these as pytest.mark.single
pytestmark = pytest.mark.skipif(
os.environ.get("PANDAS_CI", "0") == "1"
and (is_platform_windows() or is_platform_mac()),
reason="On Azure CI, Windows can fail with "
"'Windows fatal exception: stack overflow' "
"and MacOS can timeout",
)


@td.skip_if_no("numba")
@pytest.mark.filterwarnings("ignore:\n")
Expand Down
3 changes: 2 additions & 1 deletion pandas/util/_test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ def file_leak_context():
ContextManager analogue to check_file_leaks.
"""
psutil = safe_import("psutil")
if not psutil:
if not psutil or is_platform_windows():
# Checking for file leaks can hang on Windows CI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reference for this claim?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just anecdotally while investigating #45478.

I noticed disabling the analog check in the excel tests would no longer hang the build around the excel files

yield
else:
proc = psutil.Process()
Expand Down