-
Notifications
You must be signed in to change notification settings - Fork 9
Fix ARM64 CI failures by adding warning filters to hypothesis tests #463
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
Conversation
- 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]>
There was a problem hiding this 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.
There was a problem hiding this 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") |
Copilot
AI
Oct 21, 2025
There was a problem hiding this comment.
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.
| @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. |
| # 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__.*" | ||
| ) |
Copilot
AI
Oct 21, 2025
There was a problem hiding this comment.
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.
Summary
Changes
tests/test_timer.pypytest.PytestUnraisableExceptionWarning,ResourceWarning, and async-solipsism warningsTesting