Fix flaky UseReaderWithoutDisposing test on high-latency servers - #26
Open
pmishchenko-ua wants to merge 1 commit into
Open
Fix flaky UseReaderWithoutDisposing test on high-latency servers#26pmishchenko-ua wants to merge 1 commit into
pmishchenko-ua wants to merge 1 commit into
Conversation
The test starts MaximumPoolSize + 4 threads and leaves readers undisposed, so returning each connection to the pool requires a session reset. Against a high-latency managed server (the remote S2MS cluster used by the Windows CI job) those resets are slow enough that the excess threads exceed the default 15s pool-wait timeout and fail with 'Connect Timeout expired. All pooled connections are in use.' Set a generous ConnectionTimeout so the test still exercises pool reuse without being sensitive to connection latency. Co-authored-by: Pavlo Mishchenko <pmishchenko-ua@users.noreply.github.com>
pmishchenko-ua
marked this pull request as ready for review
September 2, 2026 12:37
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.
Problem
CI run 33603340491 (PR #24) failed in
test-windows→ Run SideBySide tests:PR #24 only edits
RELEASE.md, so this is unrelated to the PR — it's a pre-existing, latency-sensitive flake. It failed only on the Windows job, which runs against the remote S2MS managed cluster (aws-oregon), while every local-cluster Linux job passed.Root cause
UseReaderWithoutDisposingstartsMaximumPoolSize + 4(12) threads against a pool of 8 and deliberately leaves eachDbDataReaderundisposed. Disposing a connection whose reader still has unread rows requires a session reset (network round-trips) before the connection can be reused. Against a high-latency managed server those resets are slow enough that the 4 excess threads can exceed the default 15s pool-wait timeout (ConnectionTimeout) and throwConnect Timeout expired. All pooled connections are in use.(SingleStoreConnection.cs). Loopback-latency local clusters never hit this.Note the repo already scales timing-sensitive tests via
AppConfig.TimeoutDelayFactor, but that only recognizes AppVeyor/Travis/TF_Build/CircleCI — not GitHub Actions — so timeouts aren't scaled on the GitHub Windows runner. BroadeningIsCiBuildwould have side effects (it also disablesServerFeatures.Timeouttests), so this change is scoped to the one affected test.Fix
Give the test a generous pool-wait
ConnectionTimeout(60s) so it still exercises pool reuse under contention without being sensitive to connection latency.Verification
Reproduced and verified locally against MariaDB reached through a TCP proxy that injects 50 ms/chunk/direction latency (simulating the remote cluster's RTT). With latency and load held fixed, only
ConnectionTimeoutwas varied:ConnectionTimeoutConnect Timeout expired. All pooled connections are in use.(44s, identical to CI)The reproduction produced the exact same exception and duration as the failing CI job, isolating the pool-wait timeout as the cause.