mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Bug 1575021 - [mozrunner] Don't kill an already exited process. r=webdriver-reviewers,jgraham
Differential Revision: https://phabricator.services.mozilla.com/D87736
This commit is contained in:
parent
ea75c31b4d
commit
7f58f5cde5
@ -154,9 +154,19 @@ impl RunnerProcess for FirefoxProcess {
|
||||
}
|
||||
|
||||
fn kill(&mut self) -> io::Result<process::ExitStatus> {
|
||||
debug!("Killing process {}", self.process.id());
|
||||
self.process.kill()?;
|
||||
self.process.wait()
|
||||
match self.try_wait() {
|
||||
// child has already exited, reap its exit code
|
||||
Ok(Some(status)) => return Ok(status),
|
||||
|
||||
// child still running, kill it
|
||||
Ok(None) => {
|
||||
debug!("Killing process {}", self.process.id());
|
||||
self.process.kill()?;
|
||||
return self.process.wait();
|
||||
}
|
||||
|
||||
Err(e) => return Err(e),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user