mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 05:53:27 +02:00
Promise.timeout() doesn't stack (i.e. foo.timeout(1000).timeout(1000) doesn't mean "wait 1000ms, then another 1000ms", it means that we have two 1000ms timeouts running at the same time). Fix places where it could be a problem.
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user