diff --git a/Snowflake.Data.Tests/IntegrationTests/ConnectionMultiplePoolsIT.cs b/Snowflake.Data.Tests/IntegrationTests/ConnectionMultiplePoolsIT.cs index 97b54ec59..e18b6025b 100644 --- a/Snowflake.Data.Tests/IntegrationTests/ConnectionMultiplePoolsIT.cs +++ b/Snowflake.Data.Tests/IntegrationTests/ConnectionMultiplePoolsIT.cs @@ -177,7 +177,7 @@ public void TestWaitInAQueueForAnIdleSession() { // arrange var connectionString = ConnectionString + "application=TestWaitForMaxSize3;waitingForIdleSessionTimeout=3s;maxPoolSize=2;minPoolSize=0"; - var pool = SnowflakeDbConnectionPool.GetPool(connectionString); + var pool = SnowflakeDbConnectionPool.GetPoolInternal(connectionString); Assert.AreEqual(0, pool.GetCurrentPoolSize(), "the pool is expected to be empty"); const long ADelay = 0; const long BDelay = 400; @@ -262,8 +262,7 @@ public void TestConnectionPoolNotPossibleToDisableForAllPools() public void TestConnectionPoolDisable() { // arrange - var pool = SnowflakeDbConnectionPool.GetPool(ConnectionString); - pool.SetPooling(false); + var pool = SnowflakeDbConnectionPool.GetPool(ConnectionString + ";poolingEnabled=false"); var conn1 = new SnowflakeDbConnection(); conn1.ConnectionString = ConnectionString; @@ -322,7 +321,7 @@ public void TestConnectionPoolExpirationWorks() // arrange const int ExpirationTimeoutInSeconds = 10; var connectionString = ConnectionString + $"expirationTimeout={ExpirationTimeoutInSeconds};maxPoolSize=4;minPoolSize=2"; - var pool = SnowflakeDbConnectionPool.GetPool(connectionString); + var pool = SnowflakeDbConnectionPool.GetPoolInternal(connectionString); Assert.AreEqual(0, pool.GetCurrentPoolSize()); // act diff --git a/Snowflake.Data.Tests/IntegrationTests/ConnectionSinglePoolCacheIT.cs b/Snowflake.Data.Tests/IntegrationTests/ConnectionSinglePoolCacheIT.cs index d5f8de2fb..956f7f00c 100644 --- a/Snowflake.Data.Tests/IntegrationTests/ConnectionSinglePoolCacheIT.cs +++ b/Snowflake.Data.Tests/IntegrationTests/ConnectionSinglePoolCacheIT.cs @@ -223,7 +223,7 @@ public void TestConnectionPoolDisable() { // arrange var pool = SnowflakeDbConnectionPool.GetPool(ConnectionString); - pool.SetPooling(false); + SnowflakeDbConnectionPool.SetPooling(false); var conn1 = new SnowflakeDbConnection(); conn1.ConnectionString = ConnectionString; diff --git a/Snowflake.Data.Tests/UnitTests/SnowflakeDbConnectionPoolTest.cs b/Snowflake.Data.Tests/UnitTests/SnowflakeDbConnectionPoolTest.cs index 82ad550d9..f4c0e9e9a 100644 --- a/Snowflake.Data.Tests/UnitTests/SnowflakeDbConnectionPoolTest.cs +++ b/Snowflake.Data.Tests/UnitTests/SnowflakeDbConnectionPoolTest.cs @@ -14,7 +14,7 @@ public void TestRevertPoolToPreviousVersion() { // act SnowflakeDbConnectionPool.SetOldConnectionPoolVersion(); - + // assert var sessionPool1 = SnowflakeDbConnectionPool.GetPool(_connectionString1); var sessionPool2 = SnowflakeDbConnectionPool.GetPool(_connectionString2); diff --git a/Snowflake.Data/Core/Session/SFSessionHttpClientProperties.cs b/Snowflake.Data/Core/Session/SFSessionHttpClientProperties.cs index 447839395..5ac06da13 100644 --- a/Snowflake.Data/Core/Session/SFSessionHttpClientProperties.cs +++ b/Snowflake.Data/Core/Session/SFSessionHttpClientProperties.cs @@ -223,7 +223,7 @@ private ChangedSessionBehavior ExtractChangedSession( SFSessionProperty property) => extractor.ExtractPropertyWithDefaultValue( property, - Enum.Parse, + i => (ChangedSessionBehavior)Enum.Parse(typeof(ChangedSessionBehavior), i), s => !string.IsNullOrEmpty(s) && Enum.IsDefined(typeof(ChangedSessionBehavior), s), b => true );