-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SNOW-1373131 disable connection pooling for external browser authenti…
…cation (#947) ### Description Disable connection pooling for external browser authentication ### Checklist - [x] Code compiles correctly - [x] Code is formatted according to [Coding Conventions](../blob/master/CodingConventions.md) - [x] Created tests which fail without the change (if possible) - [x] All tests passing (`dotnet test`) - [x] Extended the README / documentation, if necessary - [x] Provide JIRA issue id (if possible) or GitHub issue id in PR name
- Loading branch information
1 parent
97cceaf
commit fe51400
Showing
3 changed files
with
89 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -914,6 +914,30 @@ public void TestSSOConnectionWithUser() | |
+ ";authenticator=externalbrowser;[email protected]"; | ||
conn.Open(); | ||
Assert.AreEqual(ConnectionState.Open, conn.State); | ||
|
||
// connection pooling is disabled for external browser by default | ||
Assert.AreEqual(false, SnowflakeDbConnectionPool.GetPool(conn.ConnectionString).GetPooling()); | ||
using (IDbCommand command = conn.CreateCommand()) | ||
{ | ||
command.CommandText = "SELECT CURRENT_USER()"; | ||
Assert.AreEqual("QA", command.ExecuteScalar().ToString()); | ||
} | ||
} | ||
} | ||
|
||
[Test] | ||
[Ignore("This test requires manual interaction and therefore cannot be run in CI")] | ||
public void TestSSOConnectionWithPoolingEnabled() | ||
{ | ||
// Use external browser to log in using proper password for [email protected] | ||
using (IDbConnection conn = new SnowflakeDbConnection()) | ||
{ | ||
conn.ConnectionString | ||
= ConnectionStringWithoutAuth | ||
+ ";authenticator=externalbrowser;[email protected];POOLINGENABLED=TRUE"; | ||
conn.Open(); | ||
Assert.AreEqual(ConnectionState.Open, conn.State); | ||
Assert.AreEqual(true, SnowflakeDbConnectionPool.GetPool(conn.ConnectionString).GetPooling()); | ||
using (IDbCommand command = conn.CreateCommand()) | ||
{ | ||
command.CommandText = "SELECT CURRENT_USER()"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters