Skip to content

Commit 2c639ec

Browse files
committed
Make async request order test more reliable.
1 parent 2633842 commit 2c639ec

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft/Data/SqlClient/ConnectionPool/ChannelDbConnectionPoolTest.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,10 @@ out internalConnection
411411
new DbConnectionOptions("", null),
412412
out recycledConnection
413413
);
414+
415+
// Gives time for the recycled connection to be queued before the failed request is initiated.
416+
await Task.Delay(1000);
417+
414418
DbConnectionInternal failedConnection = null;
415419
var exceeded2 = pool.TryGetConnection(
416420
new SqlConnection("Timeout=1"),

0 commit comments

Comments
 (0)