Skip to content

Commit

Permalink
Change back to ConfigureAwait(false).
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrainger committed Oct 20, 2023
1 parent 755f1a7 commit 7271245
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/IntegrationTests/ConnectionPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public void ResetConnection(object connectionReset, int poolSize, object expecte
[Fact]
public async Task ExhaustConnectionPool()
{
#pragma warning disable xUnit1030 // Do not call ConfigureAwait(false) in test method
var csb = AppConfig.CreateConnectionStringBuilder();
csb.Pooling = true;
csb.MinimumPoolSize = 0;
Expand All @@ -57,7 +58,7 @@ public async Task ExhaustConnectionPool()
for (int i = 0; i < csb.MaximumPoolSize; i++)
{
var connection = new MySqlConnection(csb.ConnectionString);
await connection.OpenAsync().ConfigureAwait(true);
await connection.OpenAsync().ConfigureAwait(false);
connections.Add(connection);
}

Expand All @@ -71,7 +72,7 @@ public async Task ExhaustConnectionPool()
using (var extraConnection = new MySqlConnection(csb.ConnectionString))
{
var stopwatch = Stopwatch.StartNew();
await extraConnection.OpenAsync().ConfigureAwait(true);
await extraConnection.OpenAsync().ConfigureAwait(false);
stopwatch.Stop();
Assert.InRange(stopwatch.ElapsedMilliseconds, 4500, 7500);
}
Expand All @@ -80,6 +81,7 @@ public async Task ExhaustConnectionPool()

foreach (var connection in connections)
connection.Dispose();
#pragma warning restore xUnit1030 // Do not call ConfigureAwait(false) in test method
}

[Fact]
Expand Down

0 comments on commit 7271245

Please sign in to comment.