Commit 859bbafe authored by Nick Craver's avatar Nick Craver

Tests: prevent Locking tests from killing the runner.

This takes out the global build if it throws...let's not do that.
parent 90e16598
......@@ -37,15 +37,22 @@ public void AggressiveParallel(TestMode testMode)
{
void cb(object obj)
{
var conn = (IDatabase)obj;
conn.Multiplexer.ErrorMessage += delegate { Interlocked.Increment(ref errorCount); };
try
{
var conn = (IDatabase)obj;
conn.Multiplexer.ErrorMessage += delegate { Interlocked.Increment(ref errorCount); };
for (int i = 0; i < 1000; i++)
for (int i = 0; i < 1000; i++)
{
conn.LockTakeAsync("abc", "def", TimeSpan.FromSeconds(5));
}
conn.Ping();
if (Interlocked.Decrement(ref count) == 0) evt.Set();
}
catch (Exception ex)
{
conn.LockTakeAsync("abc", "def", TimeSpan.FromSeconds(5));
Assert.True(false, "Exception in AggressiveParallel callback: " + ex.Message);
}
conn.Ping();
if (Interlocked.Decrement(ref count) == 0) evt.Set();
}
int db = testMode == TestMode.Twemproxy ? 0 : 2;
ThreadPool.QueueUserWorkItem(cb, c1.GetDatabase(db));
......
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