Skip to content

test: make Python 3.13 async suite pass and cover it in CI#226

Open
krystophny wants to merge 5 commits intowaybarrios:mainfrom
computor-org:fix/python313-test-harness
Open

test: make Python 3.13 async suite pass and cover it in CI#226
krystophny wants to merge 5 commits intowaybarrios:mainfrom
computor-org:fix/python313-test-harness

Conversation

@krystophny
Copy link
Copy Markdown
Contributor

@krystophny krystophny commented Mar 25, 2026

Summary

Fix Python 3.13 test execution and add real 3.13 coverage to the project test jobs.

Changes

  • standardize async tests on anyio with the asyncio backend
  • replace Python 3.13-fragile asyncio.get_event_loop().run_until_complete(...) with asyncio.run(...)
  • remove dead asyncio_mode = "auto" config (pytest-asyncio reference after its removal)
  • add anyio>=4.0 as explicit dev dependency
  • add Python 3.13 to the Ubuntu test matrix and the Apple Silicon MLX job

Status

  • refreshed onto current upstream main (b4fa030) on 2026-04-09
  • no logic changes beyond the base refresh

Validation

  • python -m pytest tests/ -q --timeout=120 -> 1020 passed, 2 failed, 9 skipped, 20 deselected
  • the two failures are throughput assertions in tests/test_batching_deterministic.py::TestBatchingPerformance::test_batched_faster_than_sequential[asyncio] and tests/test_continuous_batching.py::TestContinuousBatchingIntegration::test_batching_improves_throughput[asyncio]
  • the async-harness changes themselves are exercising correctly; these failures are performance thresholds, not event-loop/plugin failures

@Thump604
Copy link
Copy Markdown
Collaborator

Thump604 commented Apr 8, 2026

@waybarrios, @krystophny: brief endorsement.

This addresses issue #225 (also yours). The change is sensible: standardize on anyio with the asyncio backend, replace asyncio.get_event_loop().run_until_complete(...) with asyncio.run(...), drop the dead asyncio_mode = "auto" config, add anyio>=4.0 as a dev dep, and add Python 3.13 to both the Ubuntu test matrix and the Apple Silicon MLX job.

Validation shows 129 passed, 5 deselected. Mergeable on current main. Low risk for an infrastructure improvement that would catch Python 3.13 regressions before they ship.

…pping

- Remove asyncio_mode = "auto" from pyproject.toml (pytest-asyncio was removed)
- Add anyio>=4.0 as explicit dev dependency (was only transitive via httpx)
- Add anyio_backend fixture to conftest.py restricting tests to asyncio only
  (trio is not installed)
@krystophny
Copy link
Copy Markdown
Contributor Author

Force-pushed a refresh onto current upstream main (b4fa030). No logic change beyond the base refresh. Validation on current upstream plus local stack: python -m pytest tests/ -q --timeout=120 -> 1020 passed, 2 failed, 9 skipped, 20 deselected; the two failures are throughput threshold assertions in tests/test_batching_deterministic.py and tests/test_continuous_batching.py, not async/plugin failures.

Copy link
Copy Markdown
Collaborator

@Thump604 Thump604 left a comment

Choose a reason for hiding this comment

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

Refresh confirmed on head 810fb0f against upstream main b4fa030. The async-harness changes are mechanical and low-risk: standardize on anyio with the asyncio backend, replace asyncio.get_event_loop().run_until_complete(...) with asyncio.run(...), drop the dead asyncio_mode = "auto" config (pytest-asyncio was already removed), add anyio>=4.0 as an explicit dev dependency, and add Python 3.13 to the Ubuntu test matrix plus the Apple Silicon MLX job.

CI is green on every matrix entry including the new test-matrix (3.13) and test-apple-silicon (3.13) jobs. The 2 failures from the local pytest run (test_batching_deterministic.py::TestBatchingPerformance::test_batched_faster_than_sequential and test_continuous_batching.py::TestContinuousBatchingIntegration::test_batching_improves_throughput) are throughput-threshold assertions, not event loop or plugin failures, so they do not block the async-harness change class.

Approved.

@Thump604
Copy link
Copy Markdown
Collaborator

Rechecked on April 11: this still looks like an approved candidate, but it is currently CONFLICTING, so admin merge will not help. It needs a rebase/restack onto current main before it can move.

@Thump604
Copy link
Copy Markdown
Collaborator

I split the pushable/tested Python-side cleanup out into #288. The remaining Python 3.13 CI matrix update still makes sense, but I could not publish that branch from this auth context because GitHub rejects OAuth-app pushes that modify .github/workflows/ci.yml without workflow scope. So the technical state is: tested code-side cleanup is ready in #288; the workflow-file half needs someone with workflow-capable auth to carry it.

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.

2 participants