diff --git a/Snowflake.Data.Tests/IntegrationTests/SFConnectionIT.cs b/Snowflake.Data.Tests/IntegrationTests/SFConnectionIT.cs index 067572ef4..8ed7481d0 100644 --- a/Snowflake.Data.Tests/IntegrationTests/SFConnectionIT.cs +++ b/Snowflake.Data.Tests/IntegrationTests/SFConnectionIT.cs @@ -400,7 +400,7 @@ public void TestLoginTimeout() ((SnowflakeDbException)e.InnerException).ErrorCode); } stopwatch.Stop(); - int delta = 100; // in case server time slower. + int delta = 10; // in case server time slower. // Should timeout before the defined timeout plus 1 (max backoff after timeout) Assert.LessOrEqual(stopwatch.ElapsedMilliseconds, (timeoutSec + 1) * 1000); @@ -471,12 +471,12 @@ public void TestDefaultLoginTimeout() ((SnowflakeDbException)e.InnerException).ErrorCode); stopwatch.Stop(); - int delta = 100; // in case server time slower. + int delta = 10; // in case server time slower. // Should timeout after the default timeout (300 sec) Assert.GreaterOrEqual(stopwatch.ElapsedMilliseconds, conn.ConnectionTimeout * 1000 - delta); // But never more because there's no connection timeout remaining - Assert.LessOrEqual(stopwatch.ElapsedMilliseconds, conn.ConnectionTimeout * 1000 + delta); + Assert.LessOrEqual(stopwatch.ElapsedMilliseconds, (conn.ConnectionTimeout + 1) * 1000); } } } @@ -1744,7 +1744,7 @@ public void TestAsyncLoginTimeout() } stopwatch.Stop(); - int delta = 100; // in case server time slower. + int delta = 10; // in case server time slower. // Should timeout after the minimum possible timeout with jitter Assert.GreaterOrEqual(stopwatch.ElapsedMilliseconds, 1 * 1000 - delta); @@ -1779,7 +1779,7 @@ public void TestAsyncDefaultLoginTimeout() ((SnowflakeDbException)e.InnerException).ErrorCode); } stopwatch.Stop(); - int delta = 100; // in case server time slower. + int delta = 10; // in case server time slower. // Should timeout after the default timeout (300 sec) Assert.GreaterOrEqual(stopwatch.ElapsedMilliseconds, conn.ConnectionTimeout * 1000 - delta);