1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 18:29:17 +02:00

devutil.killProcsByComm() was not falling back to SIGKILL like it should have been. Fixed. Also added a small delay between kill checks.

This commit is contained in:
Simo Kinnunen 2014-02-05 23:08:09 +09:00
parent 6893abdb75
commit 0a28757f62

View file

@ -120,7 +120,10 @@ devutil.waitForProcsToDie = function(adb, serial, comm, bin) {
return devutil.listPidsByComm(adb, serial, comm, bin) return devutil.listPidsByComm(adb, serial, comm, bin)
.then(function(pids) { .then(function(pids) {
if (pids.length) { 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() { .then(function() {
return devutil.waitForProcsToDie(adb, serial, comm, bin) return devutil.waitForProcsToDie(adb, serial, comm, bin)
}) })
.timeout(1000) .timeout(2000)
.then(function() { .catch(function() {
return devutil.killProcsByComm(adb, serial, comm, bin, -9) return devutil.killProcsByComm(adb, serial, comm, bin, -9)
}) })
}) })