Skip to content
Browse files

Changed: preventing infinite loops in clientAPI based tests

  • Loading branch information...
1 parent 0920993 commit be64d6ac5d3ba1b31f3a31a49460731342e01964 @ysw ysw committed Feb 17, 2014
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/EventStore/EventStore.Core/Bus/QueueStatsCollector.cs
View
6 src/EventStore/EventStore.Core/Bus/QueueStatsCollector.cs
@@ -245,12 +245,18 @@ public static void InitializeIdleDetection(bool enable = true)
public static void WaitIdle()
{
#if DEBUG
+ var counter = 0;
lock (_notifyLock)
{
while (_nonIdle > 0 || _length > 0 || _writerCheckpoint.Read() != _chaserCheckpoint.Read())
{
if (!Monitor.Wait(_notifyLock, 100))
+ {
Console.WriteLine("Waiting for IDLE state...");
+ counter++;
+ if (counter > 10)
+ throw new ApplicationException("Infinite loop?");
+ }
}
}
#endif

0 comments on commit be64d6a

Please sign in to comment.
Something went wrong with that request. Please try again.