Skip to content

Commit

Permalink
[dotnet] Properly close test web server without delays
Browse files Browse the repository at this point in the history
  • Loading branch information
nvborisenko committed Dec 1, 2023
1 parent 9684923 commit 7a9c7a1
Showing 1 changed file with 2 additions and 28 deletions.
30 changes: 2 additions & 28 deletions dotnet/test/common/Environment/TestWebServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,34 +150,8 @@ public void Start()

public void Stop()
{
HttpWebRequest request = WebRequest.Create(EnvironmentManager.Instance.UrlBuilder.LocalWhereIs("quitquitquit")) as HttpWebRequest;
try
{
request.GetResponse();
}
catch (WebException)
{
}

if (webserverProcess != null)
{
try
{
webserverProcess.WaitForExit(10000);
if (!webserverProcess.HasExited)
{
webserverProcess.Kill();
}
}
catch (Exception)
{
}
finally
{
webserverProcess.Dispose();
webserverProcess = null;
}
}
webserverProcess.Dispose();
webserverProcess = null;
}
}
}

0 comments on commit 7a9c7a1

Please sign in to comment.