Skip to content

Conversation

@Marenz
Copy link
Contributor

@Marenz Marenz commented Oct 21, 2025

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

- Add comprehensive warning filters for resource cleanup warnings in hypothesis tests
- Fix pytest.PytestUnraisableExceptionWarning, ResourceWarning, and event loop cleanup warnings
- Apply filters to all 4 hypothesis tests in test_timer.py
- Addresses ARM64-specific CI failures that occur due to async-solipsism integration

Signed-off-by: Mathias L. Baumann <[email protected]>
@github-actions github-actions bot added the part:tests Affects the unit, integration and performance (benchmarks) tests label Oct 21, 2025
Copy link
Contributor

@llucax llucax left a comment

Choose a reason for hiding this comment

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

It sucks and I wish we could get to the root cause eventually and fix it, but LGTM if it works for now.

@Marenz Marenz marked this pull request as ready for review October 21, 2025 15:09
@Marenz Marenz requested a review from a team as a code owner October 21, 2025 15:09
@Marenz Marenz added this pull request to the merge queue Oct 21, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes ARM64 CI test failures by adding warning filters to hypothesis-based tests in the timer module. The warnings were causing tests to fail specifically on ARM64 architecture.

  • Added warning filters to suppress pytest.PytestUnraisableExceptionWarning, ResourceWarning, and async event loop cleanup warnings
  • Applied filters consistently to 4 hypothesis-based tests
  • Updated existing filter pattern to use a more general regex for BaseEventLoop cleanup warnings

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


# https://github.com/frequenz-floss/frequenz-channels-python/issues/405
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
@pytest.mark.filterwarnings("ignore::ResourceWarning")
Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

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

The warning filter pattern has been changed from a socket-specific pattern to a BaseEventLoop cleanup pattern. Consider documenting why this change was necessary (e.g., different warning signatures on ARM64 vs x86_64) to help future maintainers understand the architecture-specific behavior.

Suggested change
@pytest.mark.filterwarnings("ignore::ResourceWarning")
@pytest.mark.filterwarnings("ignore::ResourceWarning")
# NOTE: The warning filter pattern below was changed from a socket-specific pattern
# to a BaseEventLoop cleanup pattern because different architectures (e.g., ARM64 vs x86_64)
# and Python versions emit different warning signatures for event loop cleanup.
# This filter suppresses ResourceWarnings from BaseEventLoop.__del__ in a platform-agnostic way.

Copilot uses AI. Check for mistakes.
Comment on lines +108 to +113
# https://github.com/frequenz-floss/frequenz-channels-python/issues/405
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
@pytest.mark.filterwarnings("ignore::ResourceWarning")
@pytest.mark.filterwarnings(
"ignore:Exception ignored in.* <function BaseEventLoop.__del__.*"
)
Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

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

The same set of warning filters is duplicated across multiple test functions. Consider extracting these into a pytest fixture or a custom decorator to reduce duplication and make future updates easier to maintain.

Copilot uses AI. Check for mistakes.
Merged via the queue into frequenz-floss:v1.x.x with commit fd3d9a1 Oct 21, 2025
5 checks passed
@Marenz Marenz deleted the ciflake branch October 21, 2025 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:tests Affects the unit, integration and performance (benchmarks) tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants