Skip to content

Commit 20d0964

Browse files
authored
CI/TST: Skip another s3 test that can crash GHA worker (#45651)
* CI/TST: Skip another s3 test that can crash GHA worker * skip test_user_agent * xfail strict=False another flakey test * Fix xfail condition * Fastparquet was fixed too * Accidentally removed too much
1 parent eaad460 commit 20d0964

File tree

6 files changed

+25
-46
lines changed

6 files changed

+25
-46
lines changed

.github/workflows/posix.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
COVERAGE: ${{ !contains(matrix.settings[0], 'pypy') }}
5151
concurrency:
5252
# https://github.community/t/concurrecy-not-work-for-push/183068/7
53-
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.settings[0] }}-${{ matrix.settings[1] }}
53+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.settings[0] }}-${{ matrix.settings[1] }}-${{ matrix.settings[2] }}
5454
cancel-in-progress: true
5555

5656
services:

pandas/tests/base/test_unique.py

+3
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ def test_nunique_null(null_obj, index_or_series_obj):
105105

106106

107107
@pytest.mark.single
108+
@pytest.mark.xfail(
109+
reason="Flaky in the CI. Remove once CI has a single build: GH 44584", strict=False
110+
)
108111
def test_unique_bad_unicode(index_or_series):
109112
# regression test for #34550
110113
uval = "\ud83d" # smiley emoji

pandas/tests/io/parser/test_network.py

+7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
StringIO,
88
)
99
import logging
10+
import os
1011

1112
import numpy as np
1213
import pytest
@@ -264,6 +265,12 @@ def test_read_csv_handles_boto_s3_object(self, s3_resource, tips_file):
264265
expected = read_csv(tips_file)
265266
tm.assert_frame_equal(result, expected)
266267

268+
@pytest.mark.skipif(
269+
os.environ.get("PANDAS_CI", "0") == "1",
270+
reason="This test can hang in our CI min_versions build "
271+
"and leads to '##[error]The runner has "
272+
"received a shutdown signal...' in GHA. GH: 45651",
273+
)
267274
def test_read_csv_chunked_download(self, s3_resource, caplog, s3so):
268275
# 8 MB, S3FS uses 5MB chunks
269276
import s3fs

pandas/tests/io/test_fsspec.py

-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import numpy as np
44
import pytest
55

6-
from pandas.compat import PY310
76
from pandas.compat._optional import VERSIONS
87

98
from pandas import (
@@ -182,7 +181,6 @@ def test_arrowparquet_options(fsspectest):
182181

183182
@td.skip_array_manager_not_yet_implemented # TODO(ArrayManager) fastparquet
184183
@td.skip_if_no("fastparquet")
185-
@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10")
186184
def test_fastparquet_options(fsspectest):
187185
"""Regression test for writing to a not-yet-existent GCS Parquet file."""
188186
df = DataFrame({"a": [0]})

pandas/tests/io/test_parquet.py

+6-40
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@
1313

1414
from pandas._config import get_option
1515

16-
from pandas.compat import (
17-
PY310,
18-
is_platform_windows,
19-
)
16+
from pandas.compat import is_platform_windows
2017
from pandas.compat.pyarrow import (
2118
pa_version_under2p0,
2219
pa_version_under5p0,
@@ -265,7 +262,6 @@ def test_options_py(df_compat, pa):
265262
check_round_trip(df_compat)
266263

267264

268-
@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10")
269265
def test_options_fp(df_compat, fp):
270266
# use the set option
271267

@@ -343,7 +339,6 @@ def test_get_engine_auto_error_message():
343339
get_engine("auto")
344340

345341

346-
@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10")
347342
def test_cross_engine_pa_fp(df_cross_compat, pa, fp):
348343
# cross-compat with differing reading/writing engines
349344

@@ -409,11 +404,7 @@ def test_error(self, engine):
409404
msg = "to_parquet only supports IO with DataFrames"
410405
self.check_error_on_write(obj, engine, ValueError, msg)
411406

412-
def test_columns_dtypes(self, request, engine):
413-
if PY310 and engine == "fastparquet":
414-
request.node.add_marker(
415-
pytest.mark.xfail(reason="fastparquet failing on 3.10")
416-
)
407+
def test_columns_dtypes(self, engine):
417408
df = pd.DataFrame({"string": list("abc"), "int": list(range(1, 4))})
418409

419410
# unicode
@@ -440,39 +431,27 @@ def test_columns_dtypes_invalid(self, engine):
440431
self.check_error_on_write(df, engine, ValueError, msg)
441432

442433
@pytest.mark.parametrize("compression", [None, "gzip", "snappy", "brotli"])
443-
def test_compression(self, engine, compression, request):
434+
def test_compression(self, engine, compression):
444435

445436
if compression == "snappy":
446437
pytest.importorskip("snappy")
447438

448439
elif compression == "brotli":
449440
pytest.importorskip("brotli")
450441

451-
if PY310 and engine == "fastparquet":
452-
request.node.add_marker(
453-
pytest.mark.xfail(reason="fastparquet failing on 3.10")
454-
)
455442
df = pd.DataFrame({"A": [1, 2, 3]})
456443
check_round_trip(df, engine, write_kwargs={"compression": compression})
457444

458-
def test_read_columns(self, engine, request):
445+
def test_read_columns(self, engine):
459446
# GH18154
460-
if PY310 and engine == "fastparquet":
461-
request.node.add_marker(
462-
pytest.mark.xfail(reason="fastparquet failing on 3.10")
463-
)
464447
df = pd.DataFrame({"string": list("abc"), "int": list(range(1, 4))})
465448

466449
expected = pd.DataFrame({"string": list("abc")})
467450
check_round_trip(
468451
df, engine, expected=expected, read_kwargs={"columns": ["string"]}
469452
)
470453

471-
def test_write_index(self, engine, request):
472-
if PY310 and engine == "fastparquet":
473-
request.node.add_marker(
474-
pytest.mark.xfail(reason="fastparquet failing on 3.10")
475-
)
454+
def test_write_index(self, engine):
476455
check_names = engine != "fastparquet"
477456

478457
df = pd.DataFrame({"A": [1, 2, 3]})
@@ -521,13 +500,9 @@ def test_multiindex_with_columns(self, pa):
521500
df, engine, read_kwargs={"columns": ["A", "B"]}, expected=df[["A", "B"]]
522501
)
523502

524-
def test_write_ignoring_index(self, engine, request):
503+
def test_write_ignoring_index(self, engine):
525504
# ENH 20768
526505
# Ensure index=False omits the index from the written Parquet file.
527-
if PY310 and engine == "fastparquet":
528-
request.node.add_marker(
529-
pytest.mark.xfail(reason="fastparquet failing on 3.10")
530-
)
531506
df = pd.DataFrame({"a": [1, 2, 3], "b": ["q", "r", "s"]})
532507

533508
write_kwargs = {"compression": None, "index": False}
@@ -1011,7 +986,6 @@ def test_read_parquet_manager(self, pa, using_array_manager):
1011986

1012987

1013988
class TestParquetFastParquet(Base):
1014-
@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10")
1015989
def test_basic(self, fp, df_full):
1016990
df = df_full
1017991

@@ -1029,7 +1003,6 @@ def test_duplicate_columns(self, fp):
10291003
msg = "Cannot create parquet dataset with duplicate column names"
10301004
self.check_error_on_write(df, fp, ValueError, msg)
10311005

1032-
@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10")
10331006
def test_bool_with_none(self, fp):
10341007
df = pd.DataFrame({"a": [True, None, False]})
10351008
expected = pd.DataFrame({"a": [1.0, np.nan, 0.0]}, dtype="float16")
@@ -1049,12 +1022,10 @@ def test_unsupported(self, fp):
10491022
msg = "Can't infer object conversion type"
10501023
self.check_error_on_write(df, fp, ValueError, msg)
10511024

1052-
@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10")
10531025
def test_categorical(self, fp):
10541026
df = pd.DataFrame({"a": pd.Categorical(list("abc"))})
10551027
check_round_trip(df, fp)
10561028

1057-
@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10")
10581029
def test_filter_row_groups(self, fp):
10591030
d = {"a": list(range(0, 3))}
10601031
df = pd.DataFrame(d)
@@ -1073,7 +1044,6 @@ def test_s3_roundtrip(self, df_compat, s3_resource, fp, s3so):
10731044
write_kwargs={"compression": None, "storage_options": s3so},
10741045
)
10751046

1076-
@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10")
10771047
def test_partition_cols_supported(self, fp, df_full):
10781048
# GH #23283
10791049
partition_cols = ["bool", "int"]
@@ -1091,7 +1061,6 @@ def test_partition_cols_supported(self, fp, df_full):
10911061
actual_partition_cols = fastparquet.ParquetFile(path, False).cats
10921062
assert len(actual_partition_cols) == 2
10931063

1094-
@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10")
10951064
def test_partition_cols_string(self, fp, df_full):
10961065
# GH #27117
10971066
partition_cols = "bool"
@@ -1109,7 +1078,6 @@ def test_partition_cols_string(self, fp, df_full):
11091078
actual_partition_cols = fastparquet.ParquetFile(path, False).cats
11101079
assert len(actual_partition_cols) == 1
11111080

1112-
@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10")
11131081
def test_partition_on_supported(self, fp, df_full):
11141082
# GH #23283
11151083
partition_cols = ["bool", "int"]
@@ -1145,15 +1113,13 @@ def test_error_on_using_partition_cols_and_partition_on(self, fp, df_full):
11451113
partition_cols=partition_cols,
11461114
)
11471115

1148-
@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10")
11491116
def test_empty_dataframe(self, fp):
11501117
# GH #27339
11511118
df = pd.DataFrame()
11521119
expected = df.copy()
11531120
expected.index.name = "index"
11541121
check_round_trip(df, fp, expected=expected)
11551122

1156-
@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10")
11571123
def test_timezone_aware_index(self, fp, timezone_aware_date_list):
11581124
idx = 5 * [timezone_aware_date_list]
11591125

pandas/tests/io/test_user_agent.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,25 @@
55
import http.server
66
from io import BytesIO
77
import multiprocessing
8+
import os
89
import socket
910
import time
1011
import urllib.error
1112

1213
import pytest
1314

14-
from pandas.compat import PY310
1515
import pandas.util._test_decorators as td
1616

1717
import pandas as pd
1818
import pandas._testing as tm
1919

20+
pytestmark = pytest.mark.skipif(
21+
os.environ.get("PANDAS_CI", "0") == "1",
22+
reason="This test can hang in our CI min_versions build "
23+
"and leads to '##[error]The runner has "
24+
"received a shutdown signal...' in GHA. GH 45651",
25+
)
26+
2027

2128
class BaseUserAgentResponder(http.server.BaseHTTPRequestHandler):
2229
"""
@@ -245,7 +252,6 @@ def responder(request):
245252
# TODO(ArrayManager) fastparquet
246253
marks=[
247254
td.skip_array_manager_not_yet_implemented,
248-
pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10"),
249255
],
250256
),
251257
(PickleUserAgentResponder, pd.read_pickle, None),
@@ -283,7 +289,6 @@ def test_server_and_default_headers(responder, read_method, parquet_engine):
283289
# TODO(ArrayManager) fastparquet
284290
marks=[
285291
td.skip_array_manager_not_yet_implemented,
286-
pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10"),
287292
],
288293
),
289294
(PickleUserAgentResponder, pd.read_pickle, None),

0 commit comments

Comments
 (0)