From 7ba02057df566035516f3f700b1b08dbbd076aef Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Wed, 9 Feb 2022 15:55:22 -0800 Subject: [PATCH] TST/CI: Set hypothesis deadline to None to avoid flaky failures --- pandas/conftest.py | 4 +++- pandas/tests/frame/indexing/test_where.py | 6 +----- pandas/tests/io/parser/test_parse_dates.py | 6 +----- pandas/tests/tseries/offsets/test_offsets_properties.py | 2 -- pandas/tests/tseries/offsets/test_ticks.py | 3 --- 5 files changed, 5 insertions(+), 16 deletions(-) diff --git a/pandas/conftest.py b/pandas/conftest.py index 54f49bb9f7fd6..d1669d530abb7 100644 --- a/pandas/conftest.py +++ b/pandas/conftest.py @@ -155,7 +155,9 @@ def pytest_collection_modifyitems(items, config): # is too short for a specific test, (a) try to make it faster, and (b) # if it really is slow add `@settings(deadline=...)` with a working value, # or `deadline=None` to entirely disable timeouts for that test. - deadline=500, + # 2022-02-09: Changed deadline from 500 -> None. Deadline leads to + # non-actionable, flaky CI failures (# GH 24641, 44969, 45118, 44969) + deadline=None, suppress_health_check=(hypothesis.HealthCheck.too_slow,), ) hypothesis.settings.load_profile("ci") diff --git a/pandas/tests/frame/indexing/test_where.py b/pandas/tests/frame/indexing/test_where.py index 328155ef57997..b4117f3682f79 100644 --- a/pandas/tests/frame/indexing/test_where.py +++ b/pandas/tests/frame/indexing/test_where.py @@ -1,9 +1,6 @@ from datetime import datetime -from hypothesis import ( - given, - settings, -) +from hypothesis import given import numpy as np import pytest @@ -962,7 +959,6 @@ def test_where_nullable_invalid_na(frame_or_series, any_numeric_ea_dtype): @given(data=OPTIONAL_ONE_OF_ALL) -@settings(deadline=None) # GH 44969 def test_where_inplace_casting(data): # GH 22051 df = DataFrame({"a": data}) diff --git a/pandas/tests/io/parser/test_parse_dates.py b/pandas/tests/io/parser/test_parse_dates.py index 4fa40296fbe56..2a6d4acceeaee 100644 --- a/pandas/tests/io/parser/test_parse_dates.py +++ b/pandas/tests/io/parser/test_parse_dates.py @@ -11,10 +11,7 @@ import warnings from dateutil.parser import parse as du_parse -from hypothesis import ( - given, - settings, -) +from hypothesis import given import numpy as np import pytest import pytz @@ -1696,7 +1693,6 @@ def _helper_hypothesis_delimited_date(call, date_string, **kwargs): @skip_pyarrow @given(DATETIME_NO_TZ) -@settings(deadline=None) @pytest.mark.parametrize("delimiter", list(" -./")) @pytest.mark.parametrize("dayfirst", [True, False]) @pytest.mark.parametrize( diff --git a/pandas/tests/tseries/offsets/test_offsets_properties.py b/pandas/tests/tseries/offsets/test_offsets_properties.py index 5071c816c313d..1b4fa9292c403 100644 --- a/pandas/tests/tseries/offsets/test_offsets_properties.py +++ b/pandas/tests/tseries/offsets/test_offsets_properties.py @@ -10,7 +10,6 @@ from hypothesis import ( assume, given, - settings, ) import pytest import pytz @@ -46,7 +45,6 @@ def test_on_offset_implementations(dt, offset): @given(YQM_OFFSET) -@settings(deadline=None) # GH 45118 def test_shift_across_dst(offset): # GH#18319 check that 1) timezone is correctly normalized and # 2) that hour is not incorrectly changed by this normalization diff --git a/pandas/tests/tseries/offsets/test_ticks.py b/pandas/tests/tseries/offsets/test_ticks.py index 47e7b2aa4d401..7a174b89baa9b 100644 --- a/pandas/tests/tseries/offsets/test_ticks.py +++ b/pandas/tests/tseries/offsets/test_ticks.py @@ -10,7 +10,6 @@ assume, example, given, - settings, ) import numpy as np import pytest @@ -62,7 +61,6 @@ def test_delta_to_tick(): @pytest.mark.parametrize("cls", tick_classes) -@settings(deadline=None) # GH 24641 @example(n=2, m=3) @example(n=800, m=300) @example(n=1000, m=5) @@ -84,7 +82,6 @@ def test_tick_add_sub(cls, n, m): @pytest.mark.arm_slow @pytest.mark.parametrize("cls", tick_classes) -@settings(deadline=None) @example(n=2, m=3) @given(n=INT_NEG_999_TO_POS_999, m=INT_NEG_999_TO_POS_999) def test_tick_equality(cls, n, m):