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:
parent
b9f26311ef
commit
ca8161466e
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Microsoft.AspNet.Server.Kestrel.Networking;
|
using Microsoft.AspNet.Server.Kestrel.Networking;
|
||||||
|
|
||||||
|
|
@ -42,11 +42,16 @@ namespace Microsoft.AspNet.Server.KestrelTests.TestHelpers
|
||||||
_onPost(_postHandle.InternalGetHandle());
|
_onPost(_postHandle.InternalGetHandle());
|
||||||
}
|
}
|
||||||
|
|
||||||
_postHandle.Dispose();
|
|
||||||
loopHandle.Dispose();
|
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
_uv_ref = handle => { };
|
||||||
|
_uv_unref = handle =>
|
||||||
|
{
|
||||||
|
_stopLoop = true;
|
||||||
|
_loopWh.Set();
|
||||||
|
};
|
||||||
|
|
||||||
_uv_stop = handle =>
|
_uv_stop = handle =>
|
||||||
{
|
{
|
||||||
_stopLoop = true;
|
_stopLoop = true;
|
||||||
|
|
@ -60,7 +65,6 @@ namespace Microsoft.AspNet.Server.KestrelTests.TestHelpers
|
||||||
_uv_tcp_init = (loopHandle, tcpHandle) => 0;
|
_uv_tcp_init = (loopHandle, tcpHandle) => 0;
|
||||||
_uv_close = (handle, callback) => callback(handle);
|
_uv_close = (handle, callback) => callback(handle);
|
||||||
_uv_loop_close = handle => 0;
|
_uv_loop_close = handle => 0;
|
||||||
_uv_unref = handle => { };
|
|
||||||
_uv_walk = (loop, callback, ignore) => 0;
|
_uv_walk = (loop, callback, ignore) => 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Loading…
Reference in New Issue