Skip to content

Commit a51a753

Browse files
authored
ci: avoid timeout on aarch64 tests (#1821)
1 parent b45d087 commit a51a753

File tree

2 files changed

+53
-30
lines changed

2 files changed

+53
-30
lines changed

.github/workflows/ci.yml

Lines changed: 47 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches:
66
- main
77
tags:
8-
- '**'
8+
- "**"
99
pull_request: {}
1010

1111
env:
@@ -38,7 +38,7 @@ jobs:
3838
make build-dev
3939
env:
4040
RUST_BACKTRACE: 1
41-
RUSTFLAGS: '-C instrument-coverage'
41+
RUSTFLAGS: "-C instrument-coverage"
4242
4343
- run: uv pip freeze
4444

@@ -63,17 +63,17 @@ jobs:
6363
fail-fast: false
6464
matrix:
6565
python-version:
66-
- '3.9'
67-
- '3.10'
68-
- '3.11'
69-
- '3.12'
70-
- '3.13'
71-
- '3.14'
72-
- '3.14t'
73-
- 'pypy3.10'
74-
- 'pypy3.11'
75-
- 'graalpy-3.11'
76-
- 'graalpy-3.12'
66+
- "3.9"
67+
- "3.10"
68+
- "3.11"
69+
- "3.12"
70+
- "3.13"
71+
- "3.14"
72+
- "3.14t"
73+
- "pypy3.10"
74+
- "pypy3.11"
75+
- "graalpy-3.11"
76+
- "graalpy-3.12"
7777

7878
runs-on: ubuntu-latest
7979

@@ -189,8 +189,8 @@ jobs:
189189
fail-fast: false
190190
matrix:
191191
python-version:
192-
- '3.13'
193-
- 'pypy3.10'
192+
- "3.13"
193+
- "pypy3.10"
194194

195195
steps:
196196
- uses: actions/checkout@v5
@@ -274,7 +274,7 @@ jobs:
274274
# used to lint js code
275275
- uses: actions/setup-node@v5
276276
with:
277-
node-version: '18'
277+
node-version: "18"
278278

279279
- name: install uv
280280
uses: astral-sh/setup-uv@v6
@@ -306,7 +306,7 @@ jobs:
306306

307307
- uses: actions/setup-python@v6
308308
with:
309-
python-version: '3.13'
309+
python-version: "3.13"
310310

311311
- run: pip install typing_extensions
312312

@@ -333,7 +333,7 @@ jobs:
333333
# NOTE!: as per https://github.com/pydantic/pydantic-core/pull/149 this version needs to match the version
334334
# in node_modules/pyodide/pyodide-lock.json, to get the version, run:
335335
# `cat node_modules/pyodide/pyodide-lock.json | jq .info.platform`
336-
version: '3.1.58'
336+
version: "3.1.58"
337337
actions-cache-folder: emsdk-cache
338338

339339
- name: install uv
@@ -347,7 +347,7 @@ jobs:
347347

348348
- uses: actions/setup-node@v5
349349
with:
350-
node-version: '18'
350+
node-version: "18"
351351

352352
- run: npm install
353353

@@ -365,7 +365,16 @@ jobs:
365365
# https://github.com/marketplace/actions/alls-green#why used for branch protection checks
366366
check:
367367
if: always()
368-
needs: [coverage, test-python, test-os, test-debug, lint, bench, build-wasm-emscripten]
368+
needs:
369+
[
370+
coverage,
371+
test-python,
372+
test-os,
373+
test-debug,
374+
lint,
375+
bench,
376+
build-wasm-emscripten,
377+
]
369378
runs-on: ubuntu-latest
370379
steps:
371380
- name: Decide whether the needed jobs succeeded or failed
@@ -381,7 +390,7 @@ jobs:
381390
- uses: actions/checkout@v5
382391
- uses: actions/setup-python@v6
383392
with:
384-
python-version: '3.13'
393+
python-version: "3.13"
385394
- uses: PyO3/maturin-action@v1
386395
with:
387396
command: sdist
@@ -480,7 +489,7 @@ jobs:
480489
- name: set up python
481490
uses: actions/setup-python@v6
482491
with:
483-
python-version: '3.13'
492+
python-version: "3.13"
484493
architecture: ${{ matrix.python-architecture || 'x64' }}
485494

486495
- run: pip install -U twine 'ruff==0.5.0' typing_extensions
@@ -511,7 +520,8 @@ jobs:
511520
fail-fast: false
512521
matrix:
513522
os: [linux, windows, macos]
514-
interpreter: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.13t', '3.14', '3.14t']
523+
interpreter:
524+
["3.9", "3.10", "3.11", "3.12", "3.13", "3.13t", "3.14", "3.14t"]
515525
include:
516526
# standard runners with override for macos arm
517527
- os: linux
@@ -524,7 +534,7 @@ jobs:
524534
exclude:
525535
# macos arm only supported from 3.10 and up
526536
- os: macos
527-
interpreter: '3.9'
537+
interpreter: "3.9"
528538

529539
runs-on: ${{ matrix.runs-on }}
530540
steps:
@@ -595,8 +605,8 @@ jobs:
595605
strategy:
596606
fail-fast: false
597607
matrix:
598-
target: [aarch64, armv7, s390x, ppc64le]
599-
distro: ['ubuntu22.04']
608+
target: [armv7, s390x, ppc64le]
609+
distro: ["ubuntu22.04"]
600610
include:
601611
- target: aarch64
602612
distro: alpine_latest
@@ -640,15 +650,22 @@ jobs:
640650
uv run --no-sync python -c 'import pydantic_core._pydantic_core; print(pydantic_core._pydantic_core.__version__)'
641651
642652
test-builds-os:
643-
name: test build on ${{ matrix.os }}
653+
name: test build on ${{ matrix.platform.os }}
644654
needs: [build, build-pgo]
645655

646656
strategy:
647657
fail-fast: false
648658
matrix:
649-
os: [ubuntu, macos, windows]
650-
651-
runs-on: ${{ matrix.os }}-latest
659+
platform:
660+
[
661+
{ os: linux, runs-on: ubuntu-latest },
662+
{ os: linux_aarch64, runs-on: ubuntu-24.04-arm },
663+
{ os: windows, runs-on: windows-latest },
664+
{ os: windows_aarch64, runs-on: windows-11-arm },
665+
{ os: macos, runs-on: macos-latest },
666+
]
667+
668+
runs-on: ${{ matrix.platform.runs-on }}
652669
steps:
653670
- uses: actions/checkout@v5
654671

tests/test_hypothesis.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ def url_validator():
150150

151151

152152
@given(strategies.text())
153+
@pytest.mark.timeout(
154+
300 # this is very slow on emulated alpine aarch64, https://github.com/pydantic/pydantic-core/pull/1821
155+
)
153156
@pytest.mark.thread_unsafe # https://github.com/Quansight-Labs/pytest-run-parallel/issues/20
154157
def test_urls_text(url_validator, text):
155158
try:
@@ -167,6 +170,9 @@ def multi_host_url_validator():
167170

168171

169172
@given(strategies.text())
173+
@pytest.mark.timeout(
174+
300 # this is very slow on emulated alpine aarch64, https://github.com/pydantic/pydantic-core/pull/1821
175+
)
170176
@pytest.mark.thread_unsafe # https://github.com/Quansight-Labs/pytest-run-parallel/issues/20
171177
def test_multi_host_urls_text(multi_host_url_validator, text):
172178
try:

0 commit comments

Comments
 (0)