Skip to content

Commit

Permalink
add test failing on the previous version
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-knozderko committed Aug 2, 2024
1 parent e18d8eb commit 0d57776
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Snowflake.Data.Tests/IntegrationTests/SFConnectionIT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2273,11 +2273,13 @@ public void TestUseMultiplePoolsConnectionPoolByDefault()
}

[Test]
public void TestOpenAsyncThrowExceptionWhenConnectToUnreachableHost()
[TestCase("connection_timeout=5;")]
[TestCase("")]
public void TestOpenAsyncThrowExceptionWhenConnectToUnreachableHost(string extraParameters)
{
// arrange
var connectionString = "account=testAccount;user=testUser;password=testPassword;useProxy=true;proxyHost=no.such.pro.xy;proxyPort=8080;"
+ "connection_timeout=5;";
var connectionString = "account=testAccount;user=testUser;password=testPassword;useProxy=true;proxyHost=no.such.pro.xy;proxyPort=8080;" +
extraParameters;
using (var connection = new SnowflakeDbConnection(connectionString))
{
// act
Expand All @@ -2298,7 +2300,7 @@ public void TestOpenAsyncThrowExceptionWhenOperationIsCancelled()
var connectionString = "account=testAccount;user=testUser;password=testPassword;useProxy=true;proxyHost=no.such.pro.xy;proxyPort=8080;";
using (var connection = new SnowflakeDbConnection(connectionString))
{
var shortCancellation = new CancellationTokenSource(TimeSpan.FromSeconds(5));
var shortCancellation = new CancellationTokenSource(TimeSpan.FromMilliseconds(10));

// act
var thrown = Assert.Throws<AggregateException>(() => connection.OpenAsync(shortCancellation.Token).Wait());
Expand Down

0 comments on commit 0d57776

Please sign in to comment.