Commit d0ab67f
committed
Pin that killing a diff tool actually kills it
LaunchAndKill and LaunchAndKillAsync asserted that the tool was no longer
running after DiffRunner.Kill. That assertion cannot fail: FakeDiffTool sleeps
for five seconds and then exits by itself, and WaitForRunning polls for ten, so
"gone" is true whether the kill worked or did nothing whatsoever. Both tests
pass with ProcessCleanup.Kill short circuited to a bare return - I checked.
Assert on how the process ended rather than on whether it is still there.
WindowsProcess.TryTerminateProcess passes -1 to TerminateProcess, and a
FakeDiffTool that ran out its sleep returns 0, so the exit code separates the
two with no timing in it at all.
Reading it needs a handle opened before the process goes: Process.GetProcessById
holds none of its own, so OpenLaunched touches Handle while the tool is still
running. That is the same point ProcessEx makes on the tray side.
Neutering Kill now fails both tests on the exit code.1 parent d5b319f commit d0ab67f
1 file changed
Lines changed: 48 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| 178 | + | |
| 179 | + | |
178 | 180 | | |
| 181 | + | |
179 | 182 | | |
180 | 183 | | |
181 | 184 | | |
| 185 | + | |
182 | 186 | | |
183 | 187 | | |
184 | 188 | | |
| |||
192 | 196 | | |
193 | 197 | | |
194 | 198 | | |
| 199 | + | |
| 200 | + | |
195 | 201 | | |
| 202 | + | |
196 | 203 | | |
197 | 204 | | |
198 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
199 | 240 | | |
200 | 241 | | |
201 | 242 | | |
202 | 243 | | |
203 | 244 | | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
211 | 249 | | |
212 | | - | |
| 250 | + | |
| 251 | + | |
213 | 252 | | |
214 | | - | |
215 | | - | |
| 253 | + | |
216 | 254 | | |
217 | 255 | | |
218 | 256 | | |
| |||
0 commit comments