From 98f0abe4587862f336a30aff4977b1b7d6aabf28 Mon Sep 17 00:00:00 2001 From: sfc-gh-ext-simba-lf Date: Thu, 2 Nov 2023 20:04:17 -0700 Subject: [PATCH] SNOW-878067: Modify timeout test cases --- .../IntegrationTests/SFConnectionIT.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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);