Skip to content

Commit

Permalink
SNOW-937188 adoption of new pool interfaces among tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-mhofman committed Apr 30, 2024
1 parent 7a9d811 commit c8320d8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public void TestWaitInAQueueForAnIdleSession()
{
// arrange
var connectionString = ConnectionString + "application=TestWaitForMaxSize3;waitingForIdleSessionTimeout=3s;maxPoolSize=2;minPoolSize=0";
var pool = SnowflakeDbConnectionPool.GetPool(connectionString);
var pool = SnowflakeDbConnectionPool.GetPoolInternal(connectionString);
Assert.AreEqual(0, pool.GetCurrentPoolSize(), "the pool is expected to be empty");
const long ADelay = 0;
const long BDelay = 400;
Expand Down Expand Up @@ -262,8 +262,7 @@ public void TestConnectionPoolNotPossibleToDisableForAllPools()
public void TestConnectionPoolDisable()
{
// arrange
var pool = SnowflakeDbConnectionPool.GetPool(ConnectionString);
pool.SetPooling(false);
var pool = SnowflakeDbConnectionPool.GetPool(ConnectionString + ";poolingEnabled=false");
var conn1 = new SnowflakeDbConnection();
conn1.ConnectionString = ConnectionString;

Expand Down Expand Up @@ -322,7 +321,7 @@ public void TestConnectionPoolExpirationWorks()
// arrange
const int ExpirationTimeoutInSeconds = 10;
var connectionString = ConnectionString + $"expirationTimeout={ExpirationTimeoutInSeconds};maxPoolSize=4;minPoolSize=2";
var pool = SnowflakeDbConnectionPool.GetPool(connectionString);
var pool = SnowflakeDbConnectionPool.GetPoolInternal(connectionString);
Assert.AreEqual(0, pool.GetCurrentPoolSize());

// act
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public void TestConnectionPoolDisable()
{
// arrange
var pool = SnowflakeDbConnectionPool.GetPool(ConnectionString);
pool.SetPooling(false);
SnowflakeDbConnectionPool.SetPooling(false);
var conn1 = new SnowflakeDbConnection();
conn1.ConnectionString = ConnectionString;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public void TestRevertPoolToPreviousVersion()
{
// act
SnowflakeDbConnectionPool.SetOldConnectionPoolVersion();

// assert
var sessionPool1 = SnowflakeDbConnectionPool.GetPool(_connectionString1);
var sessionPool2 = SnowflakeDbConnectionPool.GetPool(_connectionString2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ private ChangedSessionBehavior ExtractChangedSession(
SFSessionProperty property) =>
extractor.ExtractPropertyWithDefaultValue(
property,
Enum.Parse<ChangedSessionBehavior>,
i => (ChangedSessionBehavior)Enum.Parse(typeof(ChangedSessionBehavior), i),
s => !string.IsNullOrEmpty(s) && Enum.IsDefined(typeof(ChangedSessionBehavior), s),
b => true
);
Expand Down

0 comments on commit c8320d8

Please sign in to comment.