Skip to content

Commit f9926b4

Browse files
committed
* Add debugging to a different method.
1 parent 231d348 commit f9926b4

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

Tests/SystemUtils.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,29 @@ public static EasyNetQ.Management.Client.ManagementClient InitManagementClient()
4949
return new EasyNetQ.Management.Client.ManagementClient(managementUri, "guest", "guest");
5050
}
5151

52-
public static async Task WaitUntilFuncAsync(Func<bool> func, ushort retries = 40)
52+
public static async Task WaitUntilFuncAsync(Func<bool> func, ushort retries = 20)
5353
{
54+
int tries = 0;
55+
DateTime start = DateTime.Now;
56+
57+
if (s_isRunningInCI)
58+
{
59+
retries *= 2;
60+
}
61+
5462
await Task.Delay(s_initialDelaySpan);
5563

5664
while (false == func())
5765
{
66+
tries++;
5867
await Task.Delay(s_shortDelaySpan);
5968

6069
--retries;
6170
if (retries == 0)
6271
{
63-
throw new XunitException("timed out waiting on a condition!");
72+
DateTime end = DateTime.Now;
73+
TimeSpan duration = end - start;
74+
throw new XunitException($"timed out waiting on a condition after {duration}, tries: {tries}");
6475
}
6576
}
6677
}

0 commit comments

Comments
 (0)