Skip to content

Commit fc2ea58

Browse files
Test | Improve MaxPoolWaitForConnectionTest waiting time (#1465)
1 parent d74556b commit fc2ea58

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ConnectionPoolTest/ConnectionPoolTest.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,11 @@ public static void MaxPoolWaitForConnectionTest(string connectionString)
185185
ManualResetEventSlim taskAllowedToSpeak = new ManualResetEventSlim(false);
186186

187187
Task waitTask = Task.Factory.StartNew(() => MaxPoolWaitForConnectionTask(newConnectionString, internalConnection, connectionPool, taskAllowedToSpeak));
188-
Thread.Sleep(200);
188+
int count = 5;
189+
while (waitTask.Status == TaskStatus.WaitingToRun && count-- > 0)
190+
{
191+
Thread.Sleep(200);
192+
}
189193
Assert.Equal(TaskStatus.Running, waitTask.Status);
190194

191195
connection1.Close();

0 commit comments

Comments
 (0)