Skip to content

Commit

Permalink
Merge pull request #350 from snowflakedb/prep-1.2.5
Browse files Browse the repository at this point in the history
Merge Changes for  release 1.2.5
  • Loading branch information
sfc-gh-abhatnagar authored Jul 22, 2021
2 parents bfc6570 + 1db22ca commit 79bd89c
Show file tree
Hide file tree
Showing 13 changed files with 824 additions and 46 deletions.
31 changes: 31 additions & 0 deletions Snowflake.Data.Tests/Mock/MockSecretDetector.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2021 Snowflake Computing Inc. All rights reserved.
*/

using System;
using Snowflake.Data.Log;

namespace Snowflake.Data.Tests.Mock
{
class MockSecretDetector
{
public static SecretDetector.Mask MaskSecrets(string text)
{
SecretDetector.Mask result = new SecretDetector.Mask();
try
{
throw new Exception("Test exception");
}
catch (Exception ex)
{
//We'll assume that the exception was raised during masking
//to be safe consider that the log has sensitive information
//and do not raise an exception.
result.isMasked = true;
result.maskedText = ex.Message;
result.errStr = ex.Message;
}
return result;
}
}
}
1 change: 0 additions & 1 deletion Snowflake.Data.Tests/SFBaseTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ public void SFTestSetup()
Assert.IsTrue(cloud == null || cloud == "AWS" || cloud == "AZURE" || cloud == "GCP", "{0} is not supported. Specify AWS, AZURE or GCP as cloud environment", cloud);

StreamReader reader = new StreamReader("parameters.json");

var testConfigString = reader.ReadToEnd();

Dictionary<string, TestConfig> testConfigs = JsonConvert.DeserializeObject<Dictionary<string, TestConfig>>(testConfigString);
Expand Down
42 changes: 42 additions & 0 deletions Snowflake.Data.Tests/SFConnectionIT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,48 @@ class SFConnectionIT : SFBaseTest
{
private static SFLogger logger = SFLoggerFactory.GetLogger<SFConnectionIT>();


[Test]
public void testMulitpleConnectionInParallel()
{
Task[] tasks = new Task[450];
for (int i = 0; i < 450; i++)
{
tasks[i] = Task.Run(() =>
{
using (IDbConnection conn = new SnowflakeDbConnection())
{

conn.ConnectionString = ConnectionString + ";CONNECTION_TIMEOUT=30;INSECUREMODE=false";
Console.WriteLine($"{conn.ConnectionString}");

try
{
conn.Open();
}
catch (Exception e)
{
Console.WriteLine(e);
Console.WriteLine("--------------------------");
Console.WriteLine(e.InnerException);
}
}
});
}
try
{
Task.WaitAll(tasks);
}
catch (AggregateException ae)
{
Console.WriteLine("One or more exceptions occurred: ");
foreach (var ex in ae.Flatten().InnerExceptions)
Console.WriteLine(" {0}", ex.Message);

}

}

[Test]
public void TestBasicConnection()
{
Expand Down
Loading

0 comments on commit 79bd89c

Please sign in to comment.