mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 05:53:27 +02:00
Add timeouts everywhere. Should help if the ADB socket gets stuck like it sometimes does.
This commit is contained in:
@@ -27,12 +27,14 @@ module.exports = syrup.serial()
|
||||
function openService() {
|
||||
log.info('Launching HTTP API')
|
||||
return devutil.ensureUnusedPort(adb, options.serial, service.port)
|
||||
.timeout(10000)
|
||||
.then(function() {
|
||||
return adb.shell(options.serial, [
|
||||
remote.bin
|
||||
, '--lib', remote.lib
|
||||
, '--listen-http', service.port
|
||||
])
|
||||
.timeout(10000)
|
||||
.then(function(out) {
|
||||
lifecycle.share('Remote shell', out)
|
||||
streamutil.talk(log, 'Remote shell says: "%s"', out)
|
||||
@@ -40,6 +42,7 @@ module.exports = syrup.serial()
|
||||
.then(function() {
|
||||
return devutil.waitForPort(adb, options.serial, service.port)
|
||||
})
|
||||
.timeout(20000)
|
||||
.then(function(conn) {
|
||||
var ours = options.ports.pop()
|
||||
, everyones = options.ports.pop()
|
||||
@@ -62,6 +65,7 @@ module.exports = syrup.serial()
|
||||
, util.format('tcp:%d', ours)
|
||||
, util.format('tcp:%d', service.port)
|
||||
)
|
||||
.timeout(10000)
|
||||
.then(function() {
|
||||
log.info(
|
||||
'Opening HTTP API proxy on "http://%s:%s"'
|
||||
@@ -113,6 +117,7 @@ module.exports = syrup.serial()
|
||||
)
|
||||
, json: true
|
||||
})
|
||||
.timeout(10000)
|
||||
.then(function(args) {
|
||||
var display = args[1]
|
||||
assert.ok('id' in display, 'Invalid response from HTTP API')
|
||||
|
||||
Reference in New Issue
Block a user