Skip to content

Commit

Permalink
SNOW-902611 teardown of pool settings changes in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-mhofman committed Oct 10, 2023
1 parent 1ca59e1 commit cca78fa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 20 deletions.
4 changes: 2 additions & 2 deletions Snowflake.Data.Tests/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Copyright (c) 2012-2017 Snowflake Computing Inc. All rights reserved.
</layout>
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] [%-5level] [%ClassName:%line] - %message%newline" />
<conversionPattern value="%date [%thread] [%-5level] [%classname:%line] - %message%newline" />
</layout>
</appender>
</appender>
Expand All @@ -31,7 +31,7 @@ Copyright (c) 2012-2017 Snowflake Computing Inc. All rights reserved.
<appender-ref ref="RollingFileAppender" />
</root>
<root>
<level value="WARN" />
<level value="ALL" />
<appender-ref ref="ConsoleAppender" />
</root>
</log4net>
Expand Down
2 changes: 0 additions & 2 deletions Snowflake.Data.Tests/IntegrationTests/SFConnectionIT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public void TestBasicConnection()

conn.Close();
Assert.AreEqual(ConnectionState.Closed, conn.State);
SnowflakeDbConnectionPool.SetPooling(pooling);
}
}

Expand Down Expand Up @@ -1765,7 +1764,6 @@ public void TestAsyncLoginTimeout()
[Test, NonParallelizable]
public void TestAsyncDefaultLoginTimeout()
{
SnowflakeDbConnectionPool.SetPooling(false);
using (var conn = new MockSnowflakeDbConnection())
{
// unlimited retry count to trigger the timeout
Expand Down
17 changes: 1 addition & 16 deletions Snowflake.Data.Tests/IntegrationTests/SFConnectionPoolT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,11 @@ namespace Snowflake.Data.Tests.IntegrationTests
using System.Data.Common;
using Moq;

public PoolConfig()
{
_maxPoolSize = SnowflakeDbConnectionPool.GetMaxPoolSize();
_timeout = SnowflakeDbConnectionPool.GetTimeout();
_pooling = SnowflakeDbConnectionPool.GetPooling();
}

public void Reset()
{
SnowflakeDbConnectionPool.SetMaxPoolSize(_maxPoolSize);
SnowflakeDbConnectionPool.SetTimeout(_timeout);
SnowflakeDbConnectionPool.SetPooling(_pooling);
}
}

[TestFixture, NonParallelizable]
class SFConnectionPoolT : SFBaseTest
{
private static readonly PoolConfig s_previousPoolConfig = new PoolConfig();

[SetUp]
public void BeforeTest()
{
Expand Down

0 comments on commit cca78fa

Please sign in to comment.