Fix common test flakes and improve diagnostics - #30861
Open
dain wants to merge 4 commits into
Open
Conversation
The test used the same one-second interval for client heartbeats and the server timeout. A server check could therefore race with an asynchronous heartbeat and abandon an active client. Use a heartbeat interval with a clear margin below the timeout, and wait for the server to report ABANDONED_QUERY instead of relying on a fixed sleep.
PostgreSQL can interleave output from multiple backend processes between a cancellation error and its statement log. The global adjacency flag then loses the cancellation event. Retain backend process IDs from the log prefix and match cancellation statements by process. Parse all log frames even when no tracing listener is active so listener changes cannot leave stale parser state.
The transactional MERGE checks inherited the non-transactional merge session property, so the labeled mode did not match the query being tested. Use explicit sessions for both modes and attach connection creation stacks when a count differs.
Use one deadline for the concurrent operations and report unfinished SQL with worker stacks before cleanup. Cancel workers before dropping the table so cleanup is less likely to hide the original flake.
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.
Description
Reduce several recurring merge-queue test failures:
TestServerAbandonedQueries.Additional context and related issues
TestMySqlLegacyConnectorTest.testAddColumnConcurrently#27507. The concurrent ADD COLUMN change improves failure diagnostics and cleanup ordering; it does not claim to resolve the underlying database stall.Release notes
(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text: