Skip to content

Instead of skipping all riscv64 tests, only skip timeout-based tests - #7

Closed
radarhere wants to merge 1 commit into
gounthar:feat/riscv64-wheelsfrom
radarhere:feat/riscv64-wheels
Closed

Instead of skipping all riscv64 tests, only skip timeout-based tests#7
radarhere wants to merge 1 commit into
gounthar:feat/riscv64-wheelsfrom
radarhere:feat/riscv64-wheels

Conversation

@radarhere

Copy link
Copy Markdown

The latest commit added to python-pillow#9463 says

The test_redos test has a 1-second timeout that fails under QEMU emulation where riscv64 regex operations are significantly slower than on native hardware.

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.

@coderabbitai

coderabbitai Bot commented Apr 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e0195263-ea23-49fa-a136-29d2ae405400

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread Tests/helper.py
Comment on lines +166 to 172
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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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.

Suggested change
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)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

If the test suite is being run on riscv64 without emulation, then speed shouldn't be an issue.

@radarhere

Copy link
Copy Markdown
Author

python-pillow#9462 (comment)

Tests are currently skipped on riscv64 because QEMU is too slow; with native runners they could actually run.

See this PR.

@radarhere
radarhere deleted the branch gounthar:feat/riscv64-wheels April 29, 2026 19:24
@radarhere radarhere closed this Apr 29, 2026
@radarhere
radarhere deleted the feat/riscv64-wheels branch April 29, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant