You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_logger.Info("WireMock.Net server using netstandard1.3");
#elif NETSTANDARD2_0
_logger.Info("WireMock.Net server using netstandard2.0");
#elif NET46
_logger.Info("WireMock.Net server using .net 4.6.1 or higher");
#endif
#if NETSTANDARD1_3
_host.Run(_cts.Token);
is clear that IsStarted is set to true before the WebHost istance is running for real.
That causes sporadic "Connection refused" failures with code like this:
var mockServer = FluentMockServer.Start();
// we expect the server to be actually running and listening, but sometimes it's not still ready!
await new HttpClient().SendAsync(new HttpRequestMessage(HttpMethod.Head, $"http:https://localhost:{mockServer.Ports[0]}"));
A better implementation could be listening for IApplicationLifetime events:
StefH
changed the title
AspNetCoreSelfHost.IsStarted setted before the server actually started for real
Issue: AspNetCoreSelfHost.IsStarted set before the server actually started for real
Sep 2, 2018
From this code:
WireMock.Net/src/WireMock.Net/Owin/AspNetCoreSelfHost.cs
Lines 107 to 117 in 2075589
is clear that
IsStarted
is set to true before theWebHost
istance is running for real.That causes sporadic "Connection refused" failures with code like this:
A better implementation could be listening for
IApplicationLifetime
events:The text was updated successfully, but these errors were encountered: