Skip to content

Commit

Permalink
JENKINS-10785 failure to terminate logcat reading for android emulator
Browse files Browse the repository at this point in the history
Always try to terminate the logcat reader if it has not closed itself.
  • Loading branch information
oldelvet committed Sep 7, 2011
1 parent 3890aa7 commit 7dd83c1
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -531,10 +531,15 @@ private void cleanUp(PrintStream logger, Launcher launcher, AndroidSdk androidSd

// Clean up logging process
if (logcatProcess != null) {
if (killed && logcatProcess.isAlive()) {
if (logcatProcess.isAlive()) {
// This should have stopped when the emulator was,
// but if not attempt to kill the process manually
logcatProcess.kill();
// Give the logcat process a final chance to finish
Thread.sleep(5 * 1000);
if (logcatProcess.isAlive()) {
// Still alive make sure process is killed
logcatProcess.kill();
}
}
try {
logcatStream.close();
Expand Down

0 comments on commit 7dd83c1

Please sign in to comment.