diff --git a/lib/roles/device/plugins/forward.js b/lib/roles/device/plugins/forward.js index cba00c89..dccbf088 100644 --- a/lib/roles/device/plugins/forward.js +++ b/lib/roles/device/plugins/forward.js @@ -49,8 +49,8 @@ module.exports = syrup.serial() }) .then(function() { return devutil.waitForPort(adb, options.serial, service.port) + .timeout(10000) }) - .timeout(10000) .then(function(conn) { conn.end() }) diff --git a/lib/roles/device/plugins/http.js b/lib/roles/device/plugins/http.js index 6e8b7741..1e1b2009 100644 --- a/lib/roles/device/plugins/http.js +++ b/lib/roles/device/plugins/http.js @@ -41,8 +41,8 @@ module.exports = syrup.serial() }) .then(function() { return devutil.waitForPort(adb, options.serial, service.port) + .timeout(20000) }) - .timeout(20000) .then(function(conn) { var ours = options.ports.pop() , everyones = options.ports.pop() diff --git a/lib/roles/device/plugins/input.js b/lib/roles/device/plugins/input.js index a2d301f9..a8a6eb3e 100644 --- a/lib/roles/device/plugins/input.js +++ b/lib/roles/device/plugins/input.js @@ -40,24 +40,24 @@ module.exports = syrup.serial() .timeout(15000) .then(function() { return devutil.ensureUnusedPort(adb, options.serial, agent.port) + .timeout(10000) }) - .timeout(10000) .then(function() { return adb.shell(options.serial, util.format( - "export CLASSPATH='%s'; exec app_process /system/bin '%s'" - , apk.path - , apk.main - )) + "export CLASSPATH='%s'; exec app_process /system/bin '%s'" + , apk.path + , apk.main + )) + .timeout(10000) }) - .timeout(10000) .then(function(out) { lifecycle.share('InputAgent shell', out) streamutil.talk(log, 'InputAgent says: "%s"', out) }) .then(function() { return devutil.waitForPort(adb, options.serial, agent.port) + .timeout(10000) }) - .timeout(10000) .then(function(conn) { agent.socket = conn agent.writer = new ms.DelimitingStream() @@ -130,15 +130,15 @@ module.exports = syrup.serial() .timeout(15000) .then(function() { return devutil.waitForPortToFree(adb, options.serial, service.port) + .timeout(10000) }) - .timeout(10000) .then(function() { return callService(util.format("-a '%s'", apk.startAction)) }) .then(function() { return devutil.waitForPort(adb, options.serial, service.port) + .timeout(15000) }) - .timeout(15000) .then(function(conn) { service.socket = conn service.reader = conn.pipe(new ms.DelimitedStream()) diff --git a/lib/roles/device/plugins/install.js b/lib/roles/device/plugins/install.js index b02937f0..73283116 100644 --- a/lib/roles/device/plugins/install.js +++ b/lib/roles/device/plugins/install.js @@ -101,8 +101,8 @@ module.exports = syrup.serial() ) sendProgress('installing_app', guesstimate) }) + .timeout(30000) }) - .timeout(30000) .then(function() { if (message.launchActivity) { log.info( @@ -113,9 +113,9 @@ module.exports = syrup.serial() // Progress 90% sendProgress('launching_app', 90) return adb.startActivity(options.serial, message.launchActivity) + .timeout(15000) } }) - .timeout(15000) .then(function() { push.send([ channel diff --git a/lib/roles/device/plugins/stats.js b/lib/roles/device/plugins/stats.js index d9cb7a40..b9bc3a82 100644 --- a/lib/roles/device/plugins/stats.js +++ b/lib/roles/device/plugins/stats.js @@ -24,16 +24,16 @@ module.exports = syrup.serial() , '--lib', remote.lib , '--listen-stats', service.port ]) + .timeout(10000) .then(function(out) { lifecycle.share('Stats shell', out) streamutil.talk(log, 'Stats shell says: "%s"', out) }) }) - .timeout(10000) .then(function() { return devutil.waitForPort(adb, options.serial, service.port) + .timeout(15000) }) - .timeout(15000) .then(function(conn) { return lifecycle.share('Stats connection', conn) }) diff --git a/lib/roles/device/plugins/touch.js b/lib/roles/device/plugins/touch.js index 5ceffe48..f5b642c4 100644 --- a/lib/roles/device/plugins/touch.js +++ b/lib/roles/device/plugins/touch.js @@ -26,20 +26,20 @@ module.exports = syrup.serial() .timeout(10000) .then(function() { return adb.shell(options.serial, [ - remote.bin - , '--lib', remote.lib - , '--listen-input', service.port - ]) + remote.bin + , '--lib', remote.lib + , '--listen-input', service.port + ]) + .timeout(10000) }) - .timeout(10000) .then(function(out) { lifecycle.share('Touch shell', out) streamutil.talk(log, 'Touch shell says: "%s"', out) }) .then(function() { return devutil.waitForPort(adb, options.serial, service.port) + .timeout(15000) }) - .timeout(15000) .then(function(conn) { return Promise.promisifyAll(monkey.connectStream(conn)) }) diff --git a/lib/roles/device/resources/service.js b/lib/roles/device/resources/service.js index 00c6b74e..3ac7b51f 100644 --- a/lib/roles/device/resources/service.js +++ b/lib/roles/device/resources/service.js @@ -72,11 +72,13 @@ module.exports = syrup.serial() // Uninstall first to make sure we don't have any certificate // issues. return adb.uninstall(options.serial, resource.pkg) + .timeout(15000) .then(function() { return promiseutil.periodicNotify( - adb.install(options.serial, resource.apk) - , 10000 - ) + adb.install(options.serial, resource.apk) + , 10000 + ) + .timeout(60000) }) .progressed(function() { log.warn( @@ -85,7 +87,6 @@ module.exports = syrup.serial() + 'on the device?' ) }) - .timeout(60000) .then(function() { return getPath() })