File tree Expand file tree Collapse file tree 1 file changed +28
-2
lines changed
dotnet/test/common/Environment Expand file tree Collapse file tree 1 file changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -150,8 +150,34 @@ public void Start()
150
150
151
151
public void Stop ( )
152
152
{
153
- webserverProcess . Dispose ( ) ;
154
- webserverProcess = null ;
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
+ }
155
181
}
156
182
}
157
183
}
You can’t perform that action at this time.
0 commit comments