mirror of
https://github.com/openstf/stf
synced 2025-10-04 02:09:32 +02:00
Provider better provider debug output and make fix killProcsByComm hanging on Xperia Z1.
This commit is contained in:
parent
bc9d356d7f
commit
e6a9c646e3
2 changed files with 17 additions and 4 deletions
|
@ -30,7 +30,7 @@ module.exports = function(options) {
|
||||||
function totals() {
|
function totals() {
|
||||||
if (lists.waiting.length) {
|
if (lists.waiting.length) {
|
||||||
log.info(
|
log.info(
|
||||||
'Providing %d of %d device(s), and still waiting for "%s"'
|
'Providing %d of %d device(s); waiting for "%s"'
|
||||||
, lists.ready.length
|
, lists.ready.length
|
||||||
, lists.all.length
|
, lists.all.length
|
||||||
, lists.waiting.join('", "')
|
, lists.waiting.join('", "')
|
||||||
|
@ -38,10 +38,17 @@ module.exports = function(options) {
|
||||||
|
|
||||||
delayedTotals()
|
delayedTotals()
|
||||||
}
|
}
|
||||||
|
else if (lists.ready.length < lists.all.length) {
|
||||||
|
log.info(
|
||||||
|
'Providing all %d of %d device(s); ignoring "%s"'
|
||||||
|
, lists.ready.length
|
||||||
|
, lists.all.length
|
||||||
|
, _.difference(lists.all, lists.ready).join('", "')
|
||||||
|
)
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
log.info(
|
log.info(
|
||||||
'Providing all %d of %d device(s)'
|
'Providing all %d device(s)'
|
||||||
, lists.ready.length
|
|
||||||
, lists.all.length
|
, lists.all.length
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -298,6 +305,8 @@ module.exports = function(options) {
|
||||||
proc.on('error', errorListener)
|
proc.on('error', errorListener)
|
||||||
proc.on('message', messageListener)
|
proc.on('message', messageListener)
|
||||||
|
|
||||||
|
lists.waiting.push(device.id)
|
||||||
|
|
||||||
return resolver.promise
|
return resolver.promise
|
||||||
.finally(function() {
|
.finally(function() {
|
||||||
log.info('Cleaning up device worker "%s"', device.id)
|
log.info('Cleaning up device worker "%s"', device.id)
|
||||||
|
|
|
@ -92,6 +92,10 @@ devutil.waitForPort = function(adb, serial, port) {
|
||||||
}
|
}
|
||||||
|
|
||||||
devutil.listPidsByComm = function(adb, serial, comm, bin) {
|
devutil.listPidsByComm = function(adb, serial, comm, bin) {
|
||||||
|
var users = {
|
||||||
|
shell: true
|
||||||
|
}
|
||||||
|
|
||||||
return adb.shellAsync(serial, ['ps', comm])
|
return adb.shellAsync(serial, ['ps', comm])
|
||||||
.then(function(out) {
|
.then(function(out) {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
|
@ -104,7 +108,7 @@ devutil.listPidsByComm = function(adb, serial, comm, bin) {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var cols = chunk.toString().split(/\s+/)
|
var cols = chunk.toString().split(/\s+/)
|
||||||
if (cols.pop() === bin) {
|
if (cols.pop() === bin && users[cols[0]]) {
|
||||||
pids.push(+cols[1])
|
pids.push(+cols[1])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue