@@ -98,9 +98,9 @@ public async Task TestConnectionPoolWithInvalidOpenAsync()
9898
9999 try
100100 {
101- using ( var reader = await command . ExecuteReaderAsync ( ) )
101+ using ( var reader = await command . ExecuteReaderAsync ( ) . ConfigureAwait ( false ) )
102102 {
103- while ( await reader . ReadAsync ( ) )
103+ while ( await reader . ReadAsync ( ) . ConfigureAwait ( false ) )
104104 {
105105 for ( int i = 0 ; i < reader . FieldCount ; i ++ )
106106 {
@@ -167,7 +167,7 @@ public async Task TestReleaseConnectionWhenRollbackFailsAsync()
167167 var connection = new TestSnowflakeDbConnection ( mockDbProviderFactory . Object ) ;
168168 connection . ConnectionString = connectionString ;
169169 await connection . OpenAsync ( CancellationToken . None ) . ConfigureAwait ( false ) ;
170- await connection . BeginTransactionAsync ( ) ;
170+ await connection . BeginTransactionAsync ( ) . ConfigureAwait ( false ) ;
171171 Assert . True ( connection . HasActiveExplicitTransaction ( ) ) ;
172172
173173 // act
@@ -183,7 +183,7 @@ public async Task TestConcurrentConnectionPoolingAsync()
183183 // add test case name in connection string to make in unique for each test case
184184 // set short expiration timeout to cover the case that connection expired
185185 string connStr = _fixture . ConnectionString + ";application=TestConcurrentConnectionPoolingAsync2;ExpirationTimeout=3;poolingEnabled=true" ;
186- await ConnectionSinglePoolCacheAsyncIT . ConcurrentPoolingAsyncHelper ( connStr , true , 5 , 5 , 3 ) ;
186+ await ConnectionSinglePoolCacheAsyncIT . ConcurrentPoolingAsyncHelper ( connStr , true , 5 , 5 , 3 ) . ConfigureAwait ( false ) ;
187187 }
188188
189189 [ SFFact ( DisplayName = "test connection pooling with concurrent connection and using async calls no close call for connection. Connection is closed when Dispose() is called by framework." ) ]
@@ -193,17 +193,17 @@ public async Task TestConcurrentConnectionPoolingDisposeAsync()
193193 // set short expiration timeout to cover the case that connection expired
194194 string connStr = _fixture . ConnectionString +
195195 ";application=TestConcurrentConnectionPoolingDisposeAsync2;ExpirationTimeout=3;poolingEnabled=true" ;
196- await ConnectionSinglePoolCacheAsyncIT . ConcurrentPoolingAsyncHelper ( connStr , false , 5 , 5 , 3 ) ;
196+ await ConnectionSinglePoolCacheAsyncIT . ConcurrentPoolingAsyncHelper ( connStr , false , 5 , 5 , 3 ) . ConfigureAwait ( false ) ;
197197 }
198198
199199 [ SFFact ]
200200 public async Task TestBasicConnectionPool ( )
201201 {
202202 var connectionString = _fixture . ConnectionString + "minPoolSize=0;maxPoolSize=1;poolingEnabled=true" ;
203203 var conn1 = new SnowflakeDbConnection ( connectionString ) ;
204- await conn1 . OpenAsync ( CancellationToken . None ) ;
204+ await conn1 . OpenAsync ( CancellationToken . None ) . ConfigureAwait ( false ) ;
205205 Assert . Equal ( ConnectionState . Open , conn1 . State ) ;
206- await conn1 . CloseAsync ( ) ;
206+ await conn1 . CloseAsync ( ) . ConfigureAwait ( false ) ;
207207
208208 // assert
209209 Assert . Equal ( ConnectionState . Closed , conn1 . State ) ;
@@ -216,18 +216,18 @@ public async Task TestReuseSessionInConnectionPool() // old name: TestConnection
216216 {
217217 var connectionString = _fixture . ConnectionString + "minPoolSize=1;poolingEnabled=true" ;
218218 var conn1 = new SnowflakeDbConnection ( connectionString ) ;
219- await conn1 . OpenAsync ( CancellationToken ) ;
219+ await conn1 . OpenAsync ( CancellationToken ) . ConfigureAwait ( false ) ;
220220 Assert . Equal ( ConnectionState . Open , conn1 . State ) ;
221- await conn1 . CloseAsync ( ) ;
221+ await conn1 . CloseAsync ( ) . ConfigureAwait ( false ) ;
222222 Assert . Equal ( 1 , SnowflakeDbConnectionPool . GetPool ( connectionString ) . GetCurrentPoolSize ( ) ) ;
223223
224224 var conn2 = new SnowflakeDbConnection ( ) ;
225225 conn2 . ConnectionString = connectionString ;
226- await conn2 . OpenAsync ( CancellationToken ) ;
226+ await conn2 . OpenAsync ( CancellationToken ) . ConfigureAwait ( false ) ;
227227 Assert . Equal ( ConnectionState . Open , conn2 . State ) ;
228228 Assert . Equal ( 1 , SnowflakeDbConnectionPool . GetPool ( connectionString ) . GetCurrentPoolSize ( ) ) ;
229229
230- await conn2 . CloseAsync ( ) ;
230+ await conn2 . CloseAsync ( ) . ConfigureAwait ( false ) ;
231231 Assert . Equal ( 1 , SnowflakeDbConnectionPool . GetPool ( connectionString ) . GetCurrentPoolSize ( ) ) ;
232232 Assert . Equal ( ConnectionState . Closed , conn1 . State ) ;
233233 Assert . Equal ( ConnectionState . Closed , conn2 . State ) ;
@@ -241,32 +241,32 @@ public async Task TestReuseSessionInConnectionPoolReachingMaxConnections() // ol
241241
242242 var conn1 = new SnowflakeDbConnection ( ) ;
243243 conn1 . ConnectionString = connectionString ;
244- await conn1 . OpenAsync ( CancellationToken ) ;
244+ await conn1 . OpenAsync ( CancellationToken ) . ConfigureAwait ( false ) ;
245245 Assert . Equal ( ConnectionState . Open , conn1 . State ) ;
246246
247247 var conn2 = new SnowflakeDbConnection ( ) ;
248248 conn2 . ConnectionString = connectionString ;
249- await conn2 . OpenAsync ( CancellationToken ) ;
249+ await conn2 . OpenAsync ( CancellationToken ) . ConfigureAwait ( false ) ;
250250 Assert . Equal ( ConnectionState . Open , conn2 . State ) ;
251251
252252 Assert . Equal ( 2 , pool . GetCurrentPoolSize ( ) ) ;
253- await conn1 . CloseAsync ( ) ;
254- await conn2 . CloseAsync ( ) ;
253+ await conn1 . CloseAsync ( ) . ConfigureAwait ( false ) ;
254+ await conn2 . CloseAsync ( ) . ConfigureAwait ( false ) ;
255255 Assert . Equal ( 2 , pool . GetCurrentPoolSize ( ) ) ;
256256
257257 var conn3 = new SnowflakeDbConnection ( ) ;
258258 conn3 . ConnectionString = connectionString ;
259- await conn3 . OpenAsync ( CancellationToken ) ;
259+ await conn3 . OpenAsync ( CancellationToken ) . ConfigureAwait ( false ) ;
260260 Assert . Equal ( ConnectionState . Open , conn3 . State ) ;
261261
262262 var conn4 = new SnowflakeDbConnection ( ) ;
263263 conn4 . ConnectionString = connectionString ;
264- await conn4 . OpenAsync ( CancellationToken ) ;
264+ await conn4 . OpenAsync ( CancellationToken ) . ConfigureAwait ( false ) ;
265265 Assert . Equal ( ConnectionState . Open , conn4 . State ) ;
266266
267- await conn3 . CloseAsync ( ) ;
267+ await conn3 . CloseAsync ( ) . ConfigureAwait ( false ) ;
268268 Assert . Equal ( 2 , pool . GetCurrentPoolSize ( ) ) ;
269- await conn4 . CloseAsync ( ) ;
269+ await conn4 . CloseAsync ( ) . ConfigureAwait ( false ) ;
270270 Assert . Equal ( 2 , pool . GetCurrentPoolSize ( ) ) ;
271271
272272 Assert . Equal ( ConnectionState . Closed , conn1 . State ) ;
@@ -283,8 +283,8 @@ public async Task TestWaitForTheIdleConnectionWhenExceedingMaxConnectionsLimitAs
283283 "application=TestWaitForMaxSize2;waitingForIdleSessionTimeout=1s;maxPoolSize=2;minPoolSize=1;poolingEnabled=true" ;
284284 var pool = SnowflakeDbConnectionPool . GetPool ( connectionString ) ;
285285 Assert . Equal ( 0 , pool . GetCurrentPoolSize ( ) ) ;
286- var conn1 = await OpenConnectionAsync ( connectionString ) ;
287- var conn2 = await OpenConnectionAsync ( connectionString ) ;
286+ var conn1 = await OpenConnectionAsync ( connectionString ) . ConfigureAwait ( false ) ;
287+ var conn2 = await OpenConnectionAsync ( connectionString ) . ConfigureAwait ( false ) ;
288288 var watch = new StopWatch ( ) ;
289289
290290 // act
@@ -315,13 +315,13 @@ public async Task TestBusyAndIdleConnectionsCountedInPoolSize()
315315 connection . ConnectionString = connectionString ;
316316
317317 // act
318- await connection . OpenAsync ( CancellationToken ) ;
318+ await connection . OpenAsync ( CancellationToken ) . ConfigureAwait ( false ) ;
319319
320320 // assert
321321 Assert . Equal ( 1 , pool . GetCurrentPoolSize ( ) ) ;
322322
323323 // act
324- await connection . CloseAsync ( ) ;
324+ await connection . CloseAsync ( ) . ConfigureAwait ( false ) ;
325325
326326 // assert
327327 Assert . Equal ( 1 , pool . GetCurrentPoolSize ( ) ) ;
@@ -336,14 +336,14 @@ public async Task TestConnectionPoolDisable()
336336 conn1 . ConnectionString = _fixture . ConnectionString ;
337337
338338 // act
339- await conn1 . OpenAsync ( CancellationToken ) ;
339+ await conn1 . OpenAsync ( CancellationToken ) . ConfigureAwait ( false ) ;
340340
341341 // assert
342342 Assert . Equal ( ConnectionState . Open , conn1 . State ) ;
343343 Assert . Equal ( 0 , pool . GetCurrentPoolSize ( ) ) ;
344344
345345 // act
346- await conn1 . CloseAsync ( ) ;
346+ await conn1 . CloseAsync ( ) . ConfigureAwait ( false ) ;
347347
348348 // assert
349349 Assert . Equal ( ConnectionState . Closed , conn1 . State ) ;
@@ -394,16 +394,16 @@ public async Task TestConnectionPoolExpirationWorks()
394394 Assert . Equal ( 0 , pool . GetCurrentPoolSize ( ) ) ;
395395
396396 // act
397- var conn1 = await OpenConnectionAsync ( connectionString ) ;
398- var conn2 = await OpenConnectionAsync ( connectionString ) ;
399- var conn3 = await OpenConnectionAsync ( connectionString ) ;
400- var conn4 = await OpenConnectionAsync ( connectionString ) ;
397+ var conn1 = await OpenConnectionAsync ( connectionString ) . ConfigureAwait ( false ) ;
398+ var conn2 = await OpenConnectionAsync ( connectionString ) . ConfigureAwait ( false ) ;
399+ var conn3 = await OpenConnectionAsync ( connectionString ) . ConfigureAwait ( false ) ;
400+ var conn4 = await OpenConnectionAsync ( connectionString ) . ConfigureAwait ( false ) ;
401401
402402 // assert
403403 Assert . Equal ( 4 , pool . GetCurrentPoolSize ( ) ) ;
404404
405405 // act
406- await WaitUntilAllSessionsCreatedOrTimeout ( pool ) ;
406+ await WaitUntilAllSessionsCreatedOrTimeout ( pool ) . ConfigureAwait ( false ) ;
407407 var beforeSleepMillis = DateTimeOffset . UtcNow . ToUnixTimeMilliseconds ( ) ;
408408 await Task . Delay ( TimeSpan . FromSeconds ( ExpirationTimeoutInSeconds ) ) . ConfigureAwait ( false ) ;
409409 await conn1 . CloseAsync ( CancellationToken . None ) . ConfigureAwait ( false ) ;
@@ -415,9 +415,9 @@ public async Task TestConnectionPoolExpirationWorks()
415415 Assert . Equal ( 2 , pool . GetCurrentPoolSize ( ) ) ; // 2 idle sessions, but expired because close doesn't remove expired sessions
416416
417417 // act
418- await WaitUntilAllSessionsCreatedOrTimeout ( pool ) ;
419- var conn5 = await OpenConnectionAsync ( connectionString ) ;
420- await WaitUntilAllSessionsCreatedOrTimeout ( pool ) ;
418+ await WaitUntilAllSessionsCreatedOrTimeout ( pool ) . ConfigureAwait ( false ) ;
419+ var conn5 = await OpenConnectionAsync ( connectionString ) . ConfigureAwait ( false ) ;
420+ await WaitUntilAllSessionsCreatedOrTimeout ( pool ) . ConfigureAwait ( false ) ;
421421
422422 // assert
423423 Assert . Equal ( 2 , pool . GetCurrentPoolSize ( ) ) ; // 1 idle session and 1 busy
@@ -430,7 +430,7 @@ public async Task TestConnectionPoolExpirationWorks()
430430 private static async Task WaitUntilAllSessionsCreatedOrTimeout ( SessionPool pool )
431431 {
432432 var expectingToWaitAtMostForSessionCreations = TimeSpan . FromSeconds ( 15 ) ;
433- await Awaiter . WaitUntilConditionOrTimeout ( ( ) => pool . OngoingSessionCreationsCount ( ) == 0 , expectingToWaitAtMostForSessionCreations ) ;
433+ await Awaiter . WaitUntilConditionOrTimeout ( ( ) => pool . OngoingSessionCreationsCount ( ) == 0 , expectingToWaitAtMostForSessionCreations ) . ConfigureAwait ( false ) ;
434434 }
435435
436436 private async Task < SnowflakeDbConnection > OpenConnectionAsync ( string connectionString )
0 commit comments