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 692bb36 commit d0a445e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Snowflake.Data.Tests/IntegrationTests/SFConnectionIT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,11 @@ public void TestLoginTimeout()
stopwatch.Stop();
int delta = 100; // in case server time slower.

// Should timeout before the defined timeout
Assert.LessOrEqual(stopwatch.ElapsedMilliseconds, (timeoutSec + 1) * 1000);
// Should timeout after the minimum possible timeout with jitter
Assert.GreaterOrEqual(stopwatch.ElapsedMilliseconds, 1 * 1000 - delta);
// But never more than 1 sec (max backoff) after the defined timeout
Assert.LessOrEqual(stopwatch.ElapsedMilliseconds, (timeoutSec + 1) * 1000);

Assert.AreEqual(timeoutSec, conn.ConnectionTimeout);
}
}
Expand Down

0 comments on commit d0a445e

Please sign in to comment.