diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e8e1a2cf7..020a75f15 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,12 +50,20 @@ jobs: path: ./dist/tornado-*.tar.gz build_wheels: - name: Build wheels on ${{ matrix.os }} + name: Build wheels on ${{ matrix.os }}${{ matrix.name_suffix || '' }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-24.04, ubuntu-24.04-arm, windows-2025, windows-11-arm, macos-15] + include: + - os: ubuntu-24.04 + - os: ubuntu-24.04-arm + - os: ubuntu-24.04 + cibw_archs: "riscv64" + name_suffix: "-riscv64" + - os: windows-2025 + - os: windows-11-arm + - os: macos-15 steps: - uses: actions/checkout@v4 @@ -66,8 +74,18 @@ jobs: with: python-version: ${{ env.python-version }} + - name: Set up QEMU + if: matrix.cibw_archs == 'riscv64' + uses: docker/setup-qemu-action@v3 + with: + platforms: riscv64 + - name: Build wheels - uses: pypa/cibuildwheel@v3.1.3 + uses: pypa/cibuildwheel@v3.3.0 + env: + CIBW_ARCHS: ${{ matrix.cibw_archs || 'auto' }} + # Increase timeouts for RISC-V due to QEMU emulation slowness + CIBW_ENVIRONMENT: ${{ matrix.cibw_archs == 'riscv64' && 'ASYNC_TEST_TIMEOUT=30' || '' }} - name: Audit ABI3 compliance # This may be moved into cibuildwheel itself in the future. See @@ -76,7 +94,7 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: artifacts-${{ matrix.os }} + name: artifacts-${{ matrix.os }}${{ matrix.name_suffix || '' }} path: ./wheelhouse/*.whl upload_pypi_test: diff --git a/tornado/test/httputil_test.py b/tornado/test/httputil_test.py index 7a46b9115..3629898db 100644 --- a/tornado/test/httputil_test.py +++ b/tornado/test/httputil_test.py @@ -18,6 +18,7 @@ import datetime import logging import pickle +import platform import time import urllib.parse import unittest @@ -648,6 +649,7 @@ def test_unquote(self): c = parse_cookie(encoded) self.assertEqual(c["a"], decoded) + @unittest.skipIf(platform.machine() == "riscv64", "Performance test unreliable under QEMU emulation") def test_unquote_large(self): # Adapted from # https://github.com/python/cpython/blob/dc7a2b6522ec7af41282bc34f405bee9b306d611/Lib/test/test_http_cookies.py#L87 diff --git a/tornado/test/simple_httpclient_test.py b/tornado/test/simple_httpclient_test.py index 9b21acada..102738ad6 100644 --- a/tornado/test/simple_httpclient_test.py +++ b/tornado/test/simple_httpclient_test.py @@ -3,11 +3,13 @@ import errno import logging import os +import platform import re import socket import ssl import sys import typing # noqa: F401 +import unittest from tornado.escape import to_unicode, utf8 from tornado import gen, version @@ -315,6 +317,7 @@ async def resolve(self, *args, **kwargs): cleanup_event.set() yield gen.sleep(0.2) + @unittest.skipIf(platform.machine() == "riscv64", "Test has race conditions under QEMU emulation") def test_request_timeout(self): timeout = 0.1 if os.name == "nt":