diff --git a/Snowflake.Data.Tests/IntegrationTests/SFConnectionIT.cs b/Snowflake.Data.Tests/IntegrationTests/SFConnectionIT.cs index 4f192094b..490ed1e5b 100644 --- a/Snowflake.Data.Tests/IntegrationTests/SFConnectionIT.cs +++ b/Snowflake.Data.Tests/IntegrationTests/SFConnectionIT.cs @@ -380,7 +380,7 @@ public void TestLoginTimeout() using (IDbConnection conn = new MockSnowflakeDbConnection()) { int timeoutSec = 5; - string loginTimeOut5sec = String.Format(ConnectionString + "connection_timeout={0}", + string loginTimeOut5sec = String.Format(ConnectionString + "connection_timeout={0};maxHttpRetries=0", timeoutSec); conn.ConnectionString = loginTimeOut5sec; @@ -404,8 +404,8 @@ public void TestLoginTimeout() // Should timeout before the defined timeout plus 1 (buffer time) Assert.LessOrEqual(stopwatch.ElapsedMilliseconds, (timeoutSec + 1) * 1000); - // Should timeout after the minimum possible timeout with jitter - Assert.GreaterOrEqual(stopwatch.ElapsedMilliseconds, 1 * 1000 - delta); + // Should timeout after the defined timeout since retry count is infinite + Assert.GreaterOrEqual(stopwatch.ElapsedMilliseconds, timeoutSec * 1000 - delta); Assert.AreEqual(timeoutSec, conn.ConnectionTimeout); } @@ -1724,7 +1724,7 @@ public void TestAsyncLoginTimeout() using (var conn = new MockSnowflakeDbConnection()) { int timeoutSec = 5; - string loginTimeOut5sec = String.Format(ConnectionString + "connection_timeout={0}", + string loginTimeOut5sec = String.Format(ConnectionString + "connection_timeout={0};maxHttpRetries=0", timeoutSec); conn.ConnectionString = loginTimeOut5sec; @@ -1745,8 +1745,8 @@ public void TestAsyncLoginTimeout() stopwatch.Stop(); int delta = 10; // in case server time slower. - // Should timeout after the minimum possible timeout with jitter - Assert.GreaterOrEqual(stopwatch.ElapsedMilliseconds, 1 * 1000 - delta); + // Should timeout after the defined timeout since retry count is infinite + Assert.GreaterOrEqual(stopwatch.ElapsedMilliseconds, timeoutSec * 1000 - delta); // But never more than 1 sec (buffer time) after the defined timeout Assert.LessOrEqual(stopwatch.ElapsedMilliseconds, (timeoutSec + 1) * 1000); diff --git a/Snowflake.Data/Core/HttpUtil.cs b/Snowflake.Data/Core/HttpUtil.cs index 870dcb25e..834928afc 100755 --- a/Snowflake.Data/Core/HttpUtil.cs +++ b/Snowflake.Data/Core/HttpUtil.cs @@ -459,7 +459,6 @@ protected override async Task SendAsync(HttpRequestMessage requestMessage.RequestUri = updater.Update(errorReason); - logger.Debug($"Sleep {backOffInSec} seconds and then retry the request, retryCount: {retryCount}"); await Task.Delay(TimeSpan.FromSeconds(backOffInSec), cancellationToken).ConfigureAwait(false);