Repository navigation
Test the lost-transaction refusal on PostgreSQL too - #1782
Merged
dimitri-yatsenko merged 2 commits intoDec 1, 2026
Merged
Conversation
With #1778, PostgreSQL maps a dropped connection to LostConnectionError and reconnects, so the MySQL-only guard in test_transaction_lost_with_connection_is_not_continued is no longer needed.
dimitri-yatsenko
requested review from
MilagrosMarin,
lum-agilyti and
ttngu207
December 1, 2026 19:19
MilagrosMarin
approved these changes
Dec 1, 2026
MilagrosMarin
left a comment
Contributor
There was a problem hiding this comment.
Thanks @dimitri-yatsenko. With #1778 in, dropping the MySQL-only branch makes sense, and narrowing pytest.raises(Exception) to LostConnectionError with match="during a transaction" makes the test stricter on both backends. The outcome checks (in_transaction cleared, next query reconnects) now cover PostgreSQL as well.
Approving.
…saction-both-backends
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1777 and #1778.
test_transaction_lost_with_connection_is_not_continuedchecked the outcome only on MySQL, because PostgreSQL raised the driver's error and did not reconnect until #1776 was fixed. With #1778 merged, PostgreSQL raisesLostConnectionError("during a transaction"), clears the transaction flag, and reconnects on the next query, so the test now checks this on both backends.Test-only change.
tests/integration/test_connection_liveness.pyand the reconnect tests pass locally on MySQL and PostgreSQL (27 passed).