Skip to content

Test PostgreSQL cancellation, transactions and pool recovery across event loops - #114

Merged
egorsmkv merged 3 commits into
masterfrom
test/postgresql-lifecycles
Oct 10, 2026
Merged

egorsmkv merged 3 commits into
masterfrom
test/postgresql-lifecycles

Conversation

@egorsmkv

@egorsmkv egorsmkv commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Adds 36 real PostgreSQL cases using asyncpg and SQLAlchemy AsyncEngine across asyncio, rsloop and uvloop. Tests in-flight cancellation/timeouts with server-observed advisory lock barriers, rollback after application exceptions, concurrent transaction visibility, pool exhaustion and backend PID reuse, and replacement connections after terminating the active test backend (real server-side TCP close).

Adds isolated PostgreSQL 16 services on Linux/Python 3.10 and 3.14, locked asyncpg dependency and environment/version recording. Existing cross-platform SQLite/HTTP/WebSocket jobs remain intact. PostgreSQL tests opt in through RSLOOP_POSTGRES_DSN and use unique tables/locks, bounded cleanup and the existing task-leak fixture.

Validation actually executed:

  • Local Linux CPython 3.14.7 release build: 66 existing ecosystem cases passed, 36 PostgreSQL cases skipped (this container cannot run the server). Ruff, Pyright and locked dependency validation passed.
  • PostgreSQL CI at test-code commit 40a9ad8: Linux x86_64 / Python 3.10.22 36 passed; Linux x86_64 / Python 3.14.8 36 passed. Both used PostgreSQL 16.15, asyncpg 0.32.0, SQLAlchemy 2.0.52 and uvloop 0.23.0, comparing all three loops. No PostgreSQL case skipped in these jobs.

No rsloop production defect was reproduced; no production implementation change was needed. PostgreSQL ran in CI, not locally; PostgreSQL macOS/Windows and production-load compatibility are not claimed. The final commit updates only documentation with these actual execution environments and links. See docs/async-ecosystem-tests.md for synchronization and limits.

Final-head 40183ad CI: Async ecosystem completed successfully, including both PostgreSQL jobs (36 passed each), Linux/Python 3.10 and 3.14, macOS/Python 3.14 and Windows/Python 3.14. PostgreSQL jobs used the same server/client versions listed above. MkDocs passed. The earlier workflow was superseded by this documentation commit; those cancelled jobs are not test failures.

Final-head Tests also completed successfully: the core OS/Python matrix (including free-threaded interpreters), Rust checks, Clippy, Miri, profiling, tooling, AnyIO and Redis/hiredis are green. All three final-head workflows completed successfully; no CI failures remain.

@egorsmkv
egorsmkv merged commit b286477 into master Oct 10, 2026
46 checks passed
@egorsmkv
egorsmkv deleted the test/postgresql-lifecycles branch October 10, 2026 15:55
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