From 08780b24984b8ac848738f5fb0e9a258e8b24d23 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 2 Sep 2026 12:01:50 +0000 Subject: [PATCH] Fix flaky UseReaderWithoutDisposing test on high-latency servers 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 --- tests/SideBySide/QueryTests.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/SideBySide/QueryTests.cs b/tests/SideBySide/QueryTests.cs index a8ce1e5dd..4d24237bc 100644 --- a/tests/SideBySide/QueryTests.cs +++ b/tests/SideBySide/QueryTests.cs @@ -721,6 +721,13 @@ public void UseReaderWithoutDisposing() var csb = AppConfig.CreateConnectionStringBuilder(); csb.MaximumPoolSize = 8; + // This test intentionally starts more threads than MaximumPoolSize and leaves readers undisposed, + // so returning each connection to the pool requires a session reset. Against a high-latency managed + // server those resets are slow enough that excess threads can exceed the default 15s pool-wait + // timeout and fail with "Connect Timeout expired. All pooled connections are in use." Use a generous + // timeout so the test exercises pool reuse without being sensitive to connection latency. + csb.ConnectionTimeout = 60; + using (var connection = new SingleStoreConnection(csb.ConnectionString)) { connection.Execute(@"drop table if exists dispose_reader;