mirror of
https://github.com/openstf/stf
synced 2025-10-05 02:29:26 +02:00
Be more specific about app install failures. Also increase timeouts to deal with larger apps.
This commit is contained in:
parent
9b0f1e1dca
commit
b40f411631
1 changed files with 16 additions and 5 deletions
|
@ -97,7 +97,7 @@ module.exports = syrup.serial()
|
||||||
sendProgress('installing_app', guesstimate)
|
sendProgress('installing_app', guesstimate)
|
||||||
return promiseutil.periodicNotify(
|
return promiseutil.periodicNotify(
|
||||||
adb.installRemote(options.serial, apk)
|
adb.installRemote(options.serial, apk)
|
||||||
.timeout(60000)
|
.timeout(120000)
|
||||||
.catch(function(err) {
|
.catch(function(err) {
|
||||||
switch (err.code) {
|
switch (err.code) {
|
||||||
case 'INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES':
|
case 'INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES':
|
||||||
|
@ -109,7 +109,7 @@ module.exports = syrup.serial()
|
||||||
.timeout(15000)
|
.timeout(15000)
|
||||||
.then(function() {
|
.then(function() {
|
||||||
return adb.installRemote(options.serial, apk)
|
return adb.installRemote(options.serial, apk)
|
||||||
.timeout(60000)
|
.timeout(120000)
|
||||||
})
|
})
|
||||||
default:
|
default:
|
||||||
return Promise.reject(err)
|
return Promise.reject(err)
|
||||||
|
@ -147,7 +147,7 @@ module.exports = syrup.serial()
|
||||||
// Progress 90%
|
// Progress 90%
|
||||||
sendProgress('launching_app', 90)
|
sendProgress('launching_app', 90)
|
||||||
return adb.startActivity(options.serial, launchActivity)
|
return adb.startActivity(options.serial, launchActivity)
|
||||||
.timeout(15000)
|
.timeout(30000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -157,11 +157,22 @@ module.exports = syrup.serial()
|
||||||
, reply.okay('success')
|
, reply.okay('success')
|
||||||
])
|
])
|
||||||
})
|
})
|
||||||
.catch(function(err) {
|
.catch(Promise.TimeoutError, function(err) {
|
||||||
log.error('Installation of package "%s" failed', pkg, err.stack)
|
log.error('Installation of package "%s" failed', pkg, err.stack)
|
||||||
push.send([
|
push.send([
|
||||||
channel
|
channel
|
||||||
, reply.fail('fail')
|
, reply.fail('timeout')
|
||||||
|
])
|
||||||
|
})
|
||||||
|
.catch(function(err) {
|
||||||
|
log.error('Installation of package "%s" failed', pkg, err.stack)
|
||||||
|
// The error codes are available at https://github.com/android/
|
||||||
|
// platform_frameworks_base/blob/master/core/java/android/content/
|
||||||
|
// pm/PackageManager.java, although this could be some other
|
||||||
|
// error as well.
|
||||||
|
push.send([
|
||||||
|
channel
|
||||||
|
, reply.fail(err.code || 'fail')
|
||||||
])
|
])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue