Skip to content

Stop free-threaded CI jobs failing in setup before tests run - #1089

Merged
emeryberger merged 1 commit into
masterfrom
fix-ci-freethreaded-setup
Jul 31, 2026
Merged

Stop free-threaded CI jobs failing in setup before tests run#1089
emeryberger merged 1 commit into
masterfrom
fix-ci-freethreaded-setup

Conversation

@emeryberger

Copy link
Copy Markdown
Member

Three matrix entries — run-tests (ubuntu-latest, 3.13t), (macos-latest, 3.13t) and (ubuntu-latest, 3.14t) — have been red without ever running pytest. In each, run tests shows as skipped because an earlier setup step aborted under bash -e.

Both causes are environment drift, not code: all four free-threaded jobs passed on master's 2026-07-05 run, and the failures reproduce identically on unrelated PRs (#1087, #1088).

3.13t — hypothesis can't be built for free-threaded 3.13

Building wheel for hypothesis (pyproject.toml): finished with status 'error'
    error: failed to run custom build command for `pyo3-ffi v0.29.0`
      error: PyO3 does not support the free-threaded build of CPython versions below 3.14,
             the selected Python version is 3.13

No wheel exists for cp313t, so pip builds from source and its dependency chain pulls pyo3-ffi. Installing it best-effort fixes the step.

That alone isn't sufficient. tests/test_runningstats.py and tests/test_scalene_json.py import hypothesis at module scope, and a collection error there interrupts the entire pytest session:

ERROR tests/test_runningstats.py
ERROR tests/test_scalene_json.py
!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!

So both modules now call pytest.importorskip("hypothesis"), matching the convention already used for torch (test_torch_profiler.py) and numpy (test_issue1032_core_utilization_clamp.py).

3.14t — apt 404 on libc6-dbg

Err:9 mirror+file:/etc/apt/apt-mirrors.txt noble-updates/main amd64 libc6-dbg amd64 2.39-0ubuntu8.7
  404  Not Found [IP: 52.161.185.214 80]
E: Failed to fetch .../libc6-dbg_2.39-0ubuntu8.7_amd64.deb  404  Not Found
##[error]Process completed with exit code 100.

The runner image's package index is older than the mirror's contents. Adds apt-get update first, and stops a missing gdb from failing the job — gdb is only used by the optional Collect crash backtraces step, which is already || true guarded.

Verification

scenario before after
the two modules, hypothesis absent Interrupted: 2 errors during collection, non-zero exit 2 skipped, exit 0
the two modules, hypothesis present 4 passed 4 passed (unchanged)
full suite locally 446 passed, 13 skipped 446 passed, 13 skipped

"hypothesis absent" was exercised in a real venv without the package, not simulated. The apt change can only be exercised on an Ubuntu runner, so this PR's own 3.14t job is the test.

Note, not addressed here

ulimit -c unlimited runs in its own step, and each run: block is a separate shell, so it doesn't apply to the later pytest step — core dumps likely were never actually enabled, which would leave Collect crash backtraces with nothing to find. Fixing that means restructuring where the limit is set, which is beyond this PR's scope of un-breaking the setup steps.

🤖 Generated with Claude Code

Three matrix entries have been failing without ever running pytest --
"run tests" shows as skipped because an earlier step aborted under
"bash -e". Both causes are environment drift, not code: all four
free-threaded jobs passed on master on 2026-07-05.

3.13t (ubuntu + macos): "pip install pytest pytest-asyncio hypothesis"
fails because hypothesis has no free-threaded 3.13 wheel and its source
build pulls pyo3-ffi, which reports "PyO3 does not support the
free-threaded build of CPython versions below 3.14". Install hypothesis
separately and best-effort.

That alone isn't enough: test_runningstats.py and test_scalene_json.py
import hypothesis at module scope, and a collection error there
interrupts the *entire* pytest session, not just those two files. Both
now call pytest.importorskip("hypothesis"), matching the convention
already used for torch and numpy.

3.14t (ubuntu): "sudo apt-get install -y gdb" exits 100 on a 404 for
libc6-dbg -- the image's package index is older than the mirror's
contents. Run apt-get update first, and don't let a missing gdb stop the
job: it's only used by the optional "Collect crash backtraces" step,
which is already "|| true" guarded.

Verified locally: without hypothesis installed, the two modules used to
abort collection ("Interrupted: 2 errors during collection") and now
report "2 skipped" with exit 0; with hypothesis present they still run
(4 passed). Full suite unchanged at 446 passed, 13 skipped. The apt
change can only be exercised on an Ubuntu runner.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@emeryberger
emeryberger merged commit 9069a32 into master Jul 31, 2026
45 of 59 checks passed
@emeryberger
emeryberger deleted the fix-ci-freethreaded-setup branch July 31, 2026 20:01
emeryberger added a commit that referenced this pull request Jul 31, 2026
Brings in the non-ASCII path fix (#1087), the get_ipython() Optional
guard (#1088), and the free-threaded CI setup fix (#1089).
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