From 0a28757f62232ccdf216232e1e667c0018a5d2aa Mon Sep 17 00:00:00 2001 From: Simo Kinnunen Date: Wed, 5 Feb 2014 23:08:09 +0900 Subject: [PATCH] devutil.killProcsByComm() was not falling back to SIGKILL like it should have been. Fixed. Also added a small delay between kill checks. --- lib/util/devutil.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/util/devutil.js b/lib/util/devutil.js index b9fdb225..20f204aa 100644 --- a/lib/util/devutil.js +++ b/lib/util/devutil.js @@ -120,7 +120,10 @@ devutil.waitForProcsToDie = function(adb, serial, comm, bin) { return devutil.listPidsByComm(adb, serial, comm, bin) .then(function(pids) { if (pids.length) { - return devutil.waitForProcsToDie(adb, serial, comm, bin) + return Promise.delay(100) + .then(function() { + return devutil.waitForProcsToDie(adb, serial, comm, bin) + }) } }) } @@ -140,8 +143,8 @@ devutil.killProcsByComm = function(adb, serial, comm, bin, mode) { .then(function() { return devutil.waitForProcsToDie(adb, serial, comm, bin) }) - .timeout(1000) - .then(function() { + .timeout(2000) + .catch(function() { return devutil.killProcsByComm(adb, serial, comm, bin, -9) }) })