Allow mock libuv to shutdown gracefully.

This speeds up SocketOutputTests and reduces the total test time on my
machine from 35 seconds to 25 seconds.
This commit is contained in:
Stephen Halter 2015-09-24 17:06:28 -07:00
parent b9f26311ef
commit ca8161466e
1 changed files with 8 additions and 4 deletions

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Threading;
using Microsoft.AspNet.Server.Kestrel.Networking;
@ -42,11 +42,16 @@ namespace Microsoft.AspNet.Server.KestrelTests.TestHelpers
_onPost(_postHandle.InternalGetHandle());
}
_postHandle.Dispose();
loopHandle.Dispose();
return 0;
};
_uv_ref = handle => { };
_uv_unref = handle =>
{
_stopLoop = true;
_loopWh.Set();
};
_uv_stop = handle =>
{
_stopLoop = true;
@ -60,7 +65,6 @@ namespace Microsoft.AspNet.Server.KestrelTests.TestHelpers
_uv_tcp_init = (loopHandle, tcpHandle) => 0;
_uv_close = (handle, callback) => callback(handle);
_uv_loop_close = handle => 0;
_uv_unref = handle => { };
_uv_walk = (loop, callback, ignore) => 0;
}