Skip to content

Roll back the transaction at the end of TestStmtExec - #2691

Closed
mpyw wants to merge 1 commit into
jackc:masterfrom
mpyw:stmt-exec-rollback
Closed

mpyw wants to merge 1 commit into
jackc:masterfrom
mpyw:stmt-exec-rollback

Conversation

@mpyw

@mpyw mpyw commented Oct 18, 2026 •

Copy link
Copy Markdown

TestStmtExec begins a transaction and never commits or rolls it back. The connection stays held until the pool closes, so ensureDBValid(t, db) runs while it is still taken. This rolls the transaction back before that check, as TestTransactionLifeCycle does.

Test code only. TestStmtExec passes against PostgreSQL 17.


Found with txbypass, a linter that reports a database handle used inside a transaction it opened.

Closes mpyw/txbypass#199

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017LPfBtoL2WsS5sxue7V8XB
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.

jackc/pgx (test only, harmless): TestStmtExec never ends its transaction

1 participant