mirror of
https://github.com/openstf/stf
synced 2025-10-04 02:09:32 +02:00
Figure out how to kill monkey reliably.
This commit is contained in:
parent
403c29c60a
commit
3c55f91ee9
2 changed files with 17 additions and 5 deletions
|
@ -74,7 +74,20 @@ module.exports = function(options) {
|
||||||
})
|
})
|
||||||
.then(function() {
|
.then(function() {
|
||||||
log.info('Checking if any processes from a previous run are still up')
|
log.info('Checking if any processes from a previous run are still up')
|
||||||
return devutil.killProcsByBin(adb, options.serial, vendor.bin.dest)
|
return Promise.all([
|
||||||
|
devutil.killProcsByComm(
|
||||||
|
adb
|
||||||
|
, options.serial
|
||||||
|
, vendor.bin.comm
|
||||||
|
, vendor.bin.dest
|
||||||
|
)
|
||||||
|
, devutil.killProcsByComm(
|
||||||
|
adb
|
||||||
|
, options.serial
|
||||||
|
, 'commands.monkey'
|
||||||
|
, 'com.android.commands.monkey'
|
||||||
|
)
|
||||||
|
])
|
||||||
})
|
})
|
||||||
.then(function() {
|
.then(function() {
|
||||||
var port = 2870
|
var port = 2870
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
var util = require('util')
|
var util = require('util')
|
||||||
var path = require('path')
|
|
||||||
|
|
||||||
var split = require('split')
|
var split = require('split')
|
||||||
var Promise = require('bluebird')
|
var Promise = require('bluebird')
|
||||||
|
@ -15,6 +14,7 @@ devutil.vendorFiles = function(identity) {
|
||||||
src: pathutil.vendor(util.format(
|
src: pathutil.vendor(util.format(
|
||||||
'remote/libs/%s/remote', identity.abi))
|
'remote/libs/%s/remote', identity.abi))
|
||||||
, dest: '/data/local/tmp/remote'
|
, dest: '/data/local/tmp/remote'
|
||||||
|
, comm: 'remote'
|
||||||
, mode: 0755
|
, mode: 0755
|
||||||
}
|
}
|
||||||
, lib: {
|
, lib: {
|
||||||
|
@ -26,9 +26,8 @@ devutil.vendorFiles = function(identity) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
devutil.killProcsByBin = function(adb, serial, bin) {
|
devutil.killProcsByComm = function(adb, serial, comm, bin) {
|
||||||
var basename = path.basename(bin)
|
return adb.shellAsync(serial, ['ps', comm])
|
||||||
return adb.shellAsync(serial, ['ps', basename])
|
|
||||||
.then(function(out) {
|
.then(function(out) {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var header = false
|
var header = false
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue