Skip to content

Commit

Permalink
Wrapping .NET test web server process termination with try-catch
Browse files Browse the repository at this point in the history
  • Loading branch information
jimevans committed Sep 22, 2015
1 parent 8c106b0 commit 8f310fc
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions dotnet/test/common/Environment/TestWebServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,22 @@ public void Stop()

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

webserverProcess.Dispose();
webserverProcess = null;
}
}
}
Expand Down

0 comments on commit 8f310fc

Please sign in to comment.