Skip to content

Test real HTTP, WebSocket and database async lifecycles across event loops - #113

Merged
egorsmkv merged 1 commit into
masterfrom
test/async-ecosystem-usecases
Oct 10, 2026
Merged

egorsmkv merged 1 commit into
masterfrom
test/async-ecosystem-usecases

Conversation

@egorsmkv

@egorsmkv egorsmkv commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

The existing framework smoke scripts mostly check one successful request. They do not establish whether an application can keep using its HTTP or database pool after cancellation, timeouts, truncated responses or late worker-thread completion.

This PR adds 66 parameterized downstream lifecycle checks on top of merged #112, using actual libraries and loopback TCP/TLS or temporary SQLite databases:

  • HTTPX / HTTPcore / AnyIO: interrupted HTTP/HTTPS download releases a limit-one pool, pool timeout preserves the active response, keep-alive reuse, streaming upload/download, truncated response errors followed by recovery.
  • aiohttp: queued-request cancellation/timeouts, connector reuse, chunked transfers, truncated response recovery.
  • websockets: cancellation during fragmented receive with/without compression, whole-message recovery and ordered subsequent messages, concurrent receiver rejection and graceful close.
  • SQLAlchemy / aiosqlite: rollback and pool return after cancellation/timeout/application error, independent concurrent session streams, cancelled in-flight SQLite worker followed by a successful query.

The suite compares asyncio, native rsloop and optional uvloop. It uses event gates, aiohttp queue tracing, a WebSocket ping/pong handshake and a real blocked SQLite worker; assertions do not depend on packet boundaries. It checks leaked tasks and unhandled loop exceptions, closes resources and bounds waits. No external service or credentials are required.

A locked ecosystem dependency group and a dedicated workflow run these contracts on Linux/Python 3.10 and 3.14, macOS/Python 3.14 and Windows/Python 3.14. The job requires downstream imports and records versions; only unsupported uvloop variants skip on Windows. The ecosystem marker is excluded from the core matrix, preserving the separation from optional native dependencies.

The new documentation maps application cases to upstream contracts, explains execution and limitations, and links primary project documentation. Existing Redis/hiredis, AnyIO and framework tests remain complementary.

Validation actually executed locally on Linux, CPython 3.14.7, release extension:

  • 66/66 ecosystem cases passed with locked aiohttp 3.14.3, HTTPX 0.28.1, HTTPcore 1.0.9, AnyIO 4.14.2, websockets 17.0.1, SQLAlchemy 2.0.52, aiosqlite 0.22.1 and uvloop 0.23.0.
  • Full core Python suite with private Redis/hiredis: 511 passed, 2 known Unix-socket EPERM failures, 3 skipped, 164 deselected.
  • Tooling: 98 passed.
  • Changed Python Ruff/Pyright, lock validation and strict MkDocs: passed.

No new rsloop production defect was reproduced by these cases, so this PR changes tests, CI, dependency groups/lock and documentation only. It does not claim PostgreSQL, HTTP/2, proxy, production-load or downstream free-threaded compatibility. The local core suite is not claimed fully green.

Final-head CI (29222a5) completed successfully:

  • Async ecosystem: Linux/Python 3.10 66 passed, Linux/Python 3.14 66 passed, macOS/Python 3.14 66 passed, Windows/Python 3.14 44 passed, 22 uvloop variants skipped.
  • Tests: the full core OS/Python matrix (including free-threaded builds), default/all-feature Rust, Clippy, Miri, profiling/hotpath, tooling, AnyIO and Redis/hiredis passed.
  • MkDocs: passed.

Windows/macOS and Python 3.10 ecosystem execution took place in GitHub Actions, not locally. No CI failures remain, and the downstream scenarios required no rsloop production-code fix.

@egorsmkv
egorsmkv merged commit 02e68cb into master Oct 10, 2026
44 checks passed
@egorsmkv
egorsmkv deleted the test/async-ecosystem-usecases branch October 10, 2026 11:30
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