Commit 5957f979 authored by Nick Craver's avatar Nick Craver

Tests: PubSub: moar logging

parent 82a87cc1
...@@ -372,6 +372,7 @@ async Task RunLoop() ...@@ -372,6 +372,7 @@ async Task RunLoop()
} }
lock (syncLock) lock (syncLock)
{ {
Log("PulseAll.");
Monitor.PulseAll(syncLock); Monitor.PulseAll(syncLock);
} }
} }
...@@ -383,12 +384,16 @@ async Task RunLoop() ...@@ -383,12 +384,16 @@ async Task RunLoop()
{ {
sub.Publish(channel, i.ToString(), CommandFlags.FireAndForget); sub.Publish(channel, i.ToString(), CommandFlags.FireAndForget);
} }
Log("Send loop complete.");
if (!Monitor.Wait(syncLock, 20000)) if (!Monitor.Wait(syncLock, 20000))
{ {
throw new TimeoutException("Items: " + data.Count); throw new TimeoutException("Items: " + data.Count);
} }
Log("Unsubscribe.");
subChannel.Unsubscribe(); subChannel.Unsubscribe();
Log("Sub Ping.");
sub.Ping(); sub.Ping();
Log("Database Ping.");
muxer.GetDatabase().Ping(); muxer.GetDatabase().Ping();
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
...@@ -446,12 +451,16 @@ public async Task PubSubGetAllCorrectOrder_OnMessage_Sync() ...@@ -446,12 +451,16 @@ public async Task PubSubGetAllCorrectOrder_OnMessage_Sync()
{ {
sub.Publish(channel, i.ToString(), CommandFlags.FireAndForget); sub.Publish(channel, i.ToString(), CommandFlags.FireAndForget);
} }
Log("Send loop complete.");
if (!Monitor.Wait(syncLock, 20000)) if (!Monitor.Wait(syncLock, 20000))
{ {
throw new TimeoutException("Items: " + data.Count); throw new TimeoutException("Items: " + data.Count);
} }
Log("Unsubscribe.");
subChannel.Unsubscribe(); subChannel.Unsubscribe();
Log("Sub Ping.");
sub.Ping(); sub.Ping();
Log("Database Ping.");
muxer.GetDatabase().Ping(); muxer.GetDatabase().Ping();
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
...@@ -511,12 +520,16 @@ public async Task PubSubGetAllCorrectOrder_OnMessage_Async() ...@@ -511,12 +520,16 @@ public async Task PubSubGetAllCorrectOrder_OnMessage_Async()
{ {
sub.Publish(channel, i.ToString(), CommandFlags.FireAndForget); sub.Publish(channel, i.ToString(), CommandFlags.FireAndForget);
} }
Log("Send loop complete.");
if (!Monitor.Wait(syncLock, 20000)) if (!Monitor.Wait(syncLock, 20000))
{ {
throw new TimeoutException("Items: " + data.Count); throw new TimeoutException("Items: " + data.Count);
} }
Log("Unsubscribe.");
subChannel.Unsubscribe(); subChannel.Unsubscribe();
Log("Sub Ping.");
sub.Ping(); sub.Ping();
Log("Database Ping.");
muxer.GetDatabase().Ping(); muxer.GetDatabase().Ping();
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment