Skip to content

Commit 7a9c7a1

Browse files
committed
[dotnet] Properly close test web server without delays
1 parent 9684923 commit 7a9c7a1

File tree

1 file changed

+2
-28
lines changed

1 file changed

+2
-28
lines changed

dotnet/test/common/Environment/TestWebServer.cs

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -150,34 +150,8 @@ public void Start()
150150

151151
public void Stop()
152152
{
153-
HttpWebRequest request = WebRequest.Create(EnvironmentManager.Instance.UrlBuilder.LocalWhereIs("quitquitquit")) as HttpWebRequest;
154-
try
155-
{
156-
request.GetResponse();
157-
}
158-
catch (WebException)
159-
{
160-
}
161-
162-
if (webserverProcess != null)
163-
{
164-
try
165-
{
166-
webserverProcess.WaitForExit(10000);
167-
if (!webserverProcess.HasExited)
168-
{
169-
webserverProcess.Kill();
170-
}
171-
}
172-
catch (Exception)
173-
{
174-
}
175-
finally
176-
{
177-
webserverProcess.Dispose();
178-
webserverProcess = null;
179-
}
180-
}
153+
webserverProcess.Dispose();
154+
webserverProcess = null;
181155
}
182156
}
183157
}

0 commit comments

Comments
 (0)