Skip to content

Commit

Permalink
SNOW-878067: Modify timeout test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-ext-simba-lf committed Nov 3, 2023
1 parent ce6b2b6 commit 98f0abe
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Snowflake.Data.Tests/IntegrationTests/SFConnectionIT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
}
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 98f0abe

Please sign in to comment.