Instead of skipping all riscv64 tests, only skip timeout-based tests - #7
Instead of skipping all riscv64 tests, only skip timeout-based tests#7radarhere wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request renames the timeout_unless_slower_valgrind helper function to timeout_unless_slower and updates its logic to skip timeouts on riscv64 architectures when the AUDITWHEEL_ARCH environment variable is present. Multiple test files have been updated to use the new function name. A review comment suggests improving the robustness of the architecture detection by also checking platform.machine() to support native riscv64 hardware and various CI environments.
| def timeout_unless_slower(timeout: float) -> pytest.MarkDecorator: | ||
| if ( | ||
| "PILLOW_VALGRIND_TEST" in os.environ | ||
| or os.environ.get("AUDITWHEEL_ARCH") == "riscv64" | ||
| ): | ||
| return pytest.mark.pil_noop_mark() | ||
| return pytest.mark.timeout(timeout) |
There was a problem hiding this comment.
The architecture detection for riscv64 currently relies solely on the AUDITWHEEL_ARCH environment variable, which is specific to certain build environments (like auditwheel or manylinux containers). To make this more robust and support users running tests on native riscv64 hardware or other CI environments, it's better to also check platform.machine(). This is consistent with how is_ppc64le() is implemented later in this file.
| def timeout_unless_slower(timeout: float) -> pytest.MarkDecorator: | |
| if ( | |
| "PILLOW_VALGRIND_TEST" in os.environ | |
| or os.environ.get("AUDITWHEEL_ARCH") == "riscv64" | |
| ): | |
| return pytest.mark.pil_noop_mark() | |
| return pytest.mark.timeout(timeout) | |
| def timeout_unless_slower(timeout: float) -> pytest.MarkDecorator: | |
| import platform | |
| if ( | |
| "PILLOW_VALGRIND_TEST" in os.environ | |
| or os.environ.get("AUDITWHEEL_ARCH") == "riscv64" | |
| or platform.machine() == "riscv64" | |
| ): | |
| return pytest.mark.pil_noop_mark() | |
| return pytest.mark.timeout(timeout) |
There was a problem hiding this comment.
If the test suite is being run on riscv64 without emulation, then speed shouldn't be an issue.
See this PR. |
The latest commit added to python-pillow#9463 says
and attempts to skip the entire test suite.
I think it would less extreme to only skip timeout-based tests. We already do this when running valgrind.