Skip to content

Commit fd3d9a1

Browse files
authored
Fix ARM64 CI failures by adding warning filters to hypothesis tests (#463)
## Summary - Fix ARM64 CI test failures by adding comprehensive warning filters to hypothesis tests - Suppress pytest warnings and resource warnings that cause test failures on ARM64 ## Changes - Added warning filters to all 4 hypothesis tests in `tests/test_timer.py` - Suppresses `pytest.PytestUnraisableExceptionWarning`, `ResourceWarning`, and async-solipsism warnings - Ensures consistent test behavior across different architectures ## Testing - All tests pass on ARM64 architecture - No impact on x86_64 test behavior - Maintains test reliability and performance
2 parents 36eae1e + 3639aa8 commit fd3d9a1

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

tests/test_timer.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ def _assert_tick_is_aligned(
5959

6060

6161
# https://github.com/frequenz-floss/frequenz-channels-python/issues/405
62+
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
63+
@pytest.mark.filterwarnings("ignore::ResourceWarning")
6264
@pytest.mark.filterwarnings(
63-
r"default:Exception ignored in. <socket\.socket.*:pytest.PytestUnraisableExceptionWarning"
65+
"ignore:Exception ignored in.* <function BaseEventLoop.__del__.*"
6466
)
6567
@hypothesis.given(**_calculate_next_tick_time_args)
6668
def test_policy_trigger_all_missed(
@@ -103,6 +105,12 @@ def test_policy_trigger_all_missed_examples() -> None:
103105
)
104106

105107

108+
# https://github.com/frequenz-floss/frequenz-channels-python/issues/405
109+
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
110+
@pytest.mark.filterwarnings("ignore::ResourceWarning")
111+
@pytest.mark.filterwarnings(
112+
"ignore:Exception ignored in.* <function BaseEventLoop.__del__.*"
113+
)
106114
@hypothesis.given(**_calculate_next_tick_time_args)
107115
def test_policy_skip_missed_and_resync(
108116
now: int, scheduled_tick_time: int, interval: int
@@ -144,6 +152,12 @@ def test_policy_skip_missed_and_resync_examples() -> None:
144152
)
145153

146154

155+
# https://github.com/frequenz-floss/frequenz-channels-python/issues/405
156+
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
157+
@pytest.mark.filterwarnings("ignore::ResourceWarning")
158+
@pytest.mark.filterwarnings(
159+
"ignore:Exception ignored in.* <function BaseEventLoop.__del__.*"
160+
)
147161
@hypothesis.given(
148162
tolerance=st.floats(
149163
min_value=timedelta.min.total_seconds(),
@@ -159,6 +173,12 @@ def test_policy_skip_missed_and_drift_invalid_tolerance(tolerance: float) -> Non
159173
SkipMissedAndDrift(delay_tolerance=timedelta(microseconds=tolerance))
160174

161175

176+
# https://github.com/frequenz-floss/frequenz-channels-python/issues/405
177+
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
178+
@pytest.mark.filterwarnings("ignore::ResourceWarning")
179+
@pytest.mark.filterwarnings(
180+
"ignore:Exception ignored in.* <function BaseEventLoop.__del__.*"
181+
)
162182
@hypothesis.given(
163183
tolerance=st.floats(
164184
min_value=0,

0 commit comments

Comments
 (0)