diff --git a/Snowflake.Data.Tests/IntegrationTests/SFConnectionIT.cs b/Snowflake.Data.Tests/IntegrationTests/SFConnectionIT.cs index 7f8bc3f6d..9631d3209 100644 --- a/Snowflake.Data.Tests/IntegrationTests/SFConnectionIT.cs +++ b/Snowflake.Data.Tests/IntegrationTests/SFConnectionIT.cs @@ -35,7 +35,7 @@ public void TestBasicConnection() conn.Open(); Assert.AreEqual(ConnectionState.Open, conn.State); - Assert.AreEqual(SFSessionHttpClientProperties.DefaultRetryTimeout, conn.ConnectionTimeout); + Assert.AreEqual(SFSessionHttpClientProperties.DefaultRetryTimeout.TotalSeconds, conn.ConnectionTimeout); // Data source is empty string for now Assert.AreEqual("", ((SnowflakeDbConnection)conn).DataSource); @@ -1999,7 +1999,7 @@ public void TestAsyncDefaultLoginTimeout() Assert.LessOrEqual(stopwatch.ElapsedMilliseconds, (conn.ConnectionTimeout + 1) * 1000); Assert.AreEqual(ConnectionState.Closed, conn.State); - Assert.AreEqual(SFSessionHttpClientProperties.DefaultRetryTimeout, conn.ConnectionTimeout); + Assert.AreEqual(SFSessionHttpClientProperties.DefaultRetryTimeout.TotalSeconds, conn.ConnectionTimeout); } } diff --git a/Snowflake.Data.Tests/UnitTests/SFSessionPropertyTest.cs b/Snowflake.Data.Tests/UnitTests/SFSessionPropertyTest.cs index c4609fb7c..be9e92dd5 100644 --- a/Snowflake.Data.Tests/UnitTests/SFSessionPropertyTest.cs +++ b/Snowflake.Data.Tests/UnitTests/SFSessionPropertyTest.cs @@ -384,7 +384,6 @@ public static IEnumerable ConnectionStringTestCases() { SFSessionProperty.DISABLEQUERYCONTEXTCACHE, "true" }, { SFSessionProperty.DISABLE_CONSOLE_LOGIN, defDisableConsoleLogin }, { SFSessionProperty.ALLOWUNDERSCORESINHOST, defAllowUnderscoresInHost }, - { SFSessionProperty.DISABLEQUERYCONTEXTCACHE, "true" }, { SFSessionProperty.MAXPOOLSIZE, DefaultValue(SFSessionProperty.MAXPOOLSIZE) }, { SFSessionProperty.MINPOOLSIZE, DefaultValue(SFSessionProperty.MINPOOLSIZE) }, { SFSessionProperty.CHANGEDSESSION, DefaultValue(SFSessionProperty.CHANGEDSESSION) }, @@ -420,7 +419,13 @@ public static IEnumerable ConnectionStringTestCases() { SFSessionProperty.INCLUDERETRYREASON, defIncludeRetryReason }, { SFSessionProperty.DISABLEQUERYCONTEXTCACHE, defDisableQueryContextCache }, { SFSessionProperty.DISABLE_CONSOLE_LOGIN, "false" }, - { SFSessionProperty.ALLOWUNDERSCORESINHOST, defAllowUnderscoresInHost } + { SFSessionProperty.ALLOWUNDERSCORESINHOST, defAllowUnderscoresInHost }, + { SFSessionProperty.MAXPOOLSIZE, DefaultValue(SFSessionProperty.MAXPOOLSIZE) }, + { SFSessionProperty.MINPOOLSIZE, DefaultValue(SFSessionProperty.MINPOOLSIZE) }, + { SFSessionProperty.CHANGEDSESSION, DefaultValue(SFSessionProperty.CHANGEDSESSION) }, + { SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT, DefaultValue(SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT) }, + { SFSessionProperty.EXPIRATIONTIMEOUT, DefaultValue(SFSessionProperty.EXPIRATIONTIMEOUT) }, + { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) } }, ConnectionString = $"ACCOUNT={defAccount};USER={defUser};PASSWORD={defPassword};DISABLE_CONSOLE_LOGIN=false" @@ -452,7 +457,13 @@ public static IEnumerable ConnectionStringTestCases() { SFSessionProperty.INCLUDERETRYREASON, defIncludeRetryReason }, { SFSessionProperty.DISABLEQUERYCONTEXTCACHE, defDisableQueryContextCache }, { SFSessionProperty.DISABLE_CONSOLE_LOGIN, defDisableConsoleLogin }, - { SFSessionProperty.ALLOWUNDERSCORESINHOST, defAllowUnderscoresInHost } + { SFSessionProperty.ALLOWUNDERSCORESINHOST, defAllowUnderscoresInHost }, + { SFSessionProperty.MAXPOOLSIZE, DefaultValue(SFSessionProperty.MAXPOOLSIZE) }, + { SFSessionProperty.MINPOOLSIZE, DefaultValue(SFSessionProperty.MINPOOLSIZE) }, + { SFSessionProperty.CHANGEDSESSION, DefaultValue(SFSessionProperty.CHANGEDSESSION) }, + { SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT, DefaultValue(SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT) }, + { SFSessionProperty.EXPIRATIONTIMEOUT, DefaultValue(SFSessionProperty.EXPIRATIONTIMEOUT) }, + { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) } } }; var testCaseUnderscoredAccountName = new TestCase() @@ -481,7 +492,13 @@ public static IEnumerable ConnectionStringTestCases() { SFSessionProperty.INCLUDERETRYREASON, defIncludeRetryReason }, { SFSessionProperty.DISABLEQUERYCONTEXTCACHE, defDisableQueryContextCache }, { SFSessionProperty.DISABLE_CONSOLE_LOGIN, defDisableConsoleLogin }, - { SFSessionProperty.ALLOWUNDERSCORESINHOST, defAllowUnderscoresInHost } + { SFSessionProperty.ALLOWUNDERSCORESINHOST, defAllowUnderscoresInHost }, + { SFSessionProperty.MAXPOOLSIZE, DefaultValue(SFSessionProperty.MAXPOOLSIZE) }, + { SFSessionProperty.MINPOOLSIZE, DefaultValue(SFSessionProperty.MINPOOLSIZE) }, + { SFSessionProperty.CHANGEDSESSION, DefaultValue(SFSessionProperty.CHANGEDSESSION) }, + { SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT, DefaultValue(SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT) }, + { SFSessionProperty.EXPIRATIONTIMEOUT, DefaultValue(SFSessionProperty.EXPIRATIONTIMEOUT) }, + { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) } } }; var testCaseUnderscoredAccountNameWithEnabledAllowUnderscores = new TestCase() @@ -510,7 +527,13 @@ public static IEnumerable ConnectionStringTestCases() { SFSessionProperty.INCLUDERETRYREASON, defIncludeRetryReason }, { SFSessionProperty.DISABLEQUERYCONTEXTCACHE, defDisableQueryContextCache }, { SFSessionProperty.DISABLE_CONSOLE_LOGIN, defDisableConsoleLogin }, - { SFSessionProperty.ALLOWUNDERSCORESINHOST, "true" } + { SFSessionProperty.ALLOWUNDERSCORESINHOST, "true" }, + { SFSessionProperty.MAXPOOLSIZE, DefaultValue(SFSessionProperty.MAXPOOLSIZE) }, + { SFSessionProperty.MINPOOLSIZE, DefaultValue(SFSessionProperty.MINPOOLSIZE) }, + { SFSessionProperty.CHANGEDSESSION, DefaultValue(SFSessionProperty.CHANGEDSESSION) }, + { SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT, DefaultValue(SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT) }, + { SFSessionProperty.EXPIRATIONTIMEOUT, DefaultValue(SFSessionProperty.EXPIRATIONTIMEOUT) }, + { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) } } }; return new TestCase[] diff --git a/Snowflake.Data/Core/Authenticator/OktaAuthenticator.cs b/Snowflake.Data/Core/Authenticator/OktaAuthenticator.cs index c69ee1f28..6ec4843d4 100644 --- a/Snowflake.Data/Core/Authenticator/OktaAuthenticator.cs +++ b/Snowflake.Data/Core/Authenticator/OktaAuthenticator.cs @@ -298,7 +298,7 @@ private void ThrowRetryLimitException(int retryCount, int timeoutElapsed, Except if (TimeoutHelper.IsExpired(timeoutElapsed * 1000, session._maxRetryTimeout)) { errorMessage += string.IsNullOrEmpty(errorMessage) ? "The" : " and the"; - errorMessage += $" timeout elapsed has reached its limit of {session._maxRetryTimeout}"; + errorMessage += $" timeout elapsed has reached its limit of {session._maxRetryTimeout.TotalSeconds}"; } errorMessage += " while trying to authenticate through Okta";