mirror of
https://github.com/openstf/stf
synced 2025-10-04 10:19:30 +02:00
In-memory reaper. TtlSet needs tests.
This commit is contained in:
parent
89aedcef06
commit
25544d1a1a
10 changed files with 231 additions and 87 deletions
19
lib/cli.js
19
lib/cli.js
|
@ -50,7 +50,7 @@ program
|
|||
.option('--heartbeat-interval <ms>'
|
||||
, 'heartbeat interval'
|
||||
, Number
|
||||
, 10000)
|
||||
, 5000)
|
||||
.option('--adb-host <host>'
|
||||
, 'ADB host (defaults to 127.0.0.1)'
|
||||
, String
|
||||
|
@ -80,7 +80,6 @@ program
|
|||
require('./units/provider')({
|
||||
name: options.name
|
||||
, killTimeout: 10000
|
||||
, heartbeatInterval: options.heartbeatInterval
|
||||
, ports: cliutil.range(options.minPort, options.maxPort)
|
||||
, filter: function(device) {
|
||||
return serials.length === 0 || serials.indexOf(device.id) !== -1
|
||||
|
@ -100,6 +99,7 @@ program
|
|||
, '--adb-host', options.adbHost
|
||||
, '--adb-port', options.adbPort
|
||||
, '--screen-ws-url-pattern', options.screenWsUrlPattern
|
||||
, '--heartbeat-interval', options.heartbeatInterval
|
||||
])
|
||||
}
|
||||
, endpoints: {
|
||||
|
@ -152,6 +152,10 @@ program
|
|||
, 'screen WebSocket URL pattern'
|
||||
, String
|
||||
, 'ws://${publicIp}:${publicPort}')
|
||||
.option('--heartbeat-interval <ms>'
|
||||
, 'heartbeat interval'
|
||||
, Number
|
||||
, 5000)
|
||||
.action(function(serial, options) {
|
||||
if (!options.connectSub) {
|
||||
this.missingArgument('--connect-sub')
|
||||
|
@ -187,6 +191,7 @@ program
|
|||
, screenWsUrlPattern: options.screenWsUrlPattern
|
||||
, screenPort: options.screenPort
|
||||
, connectPort: options.connectPort
|
||||
, heartbeatInterval: options.heartbeatInterval
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -222,21 +227,20 @@ program
|
|||
.option('-p, --connect-push <endpoint>'
|
||||
, 'push endpoint'
|
||||
, cliutil.list)
|
||||
.option('-s, --connect-sub <endpoint>'
|
||||
, 'sub endpoint'
|
||||
, cliutil.list)
|
||||
.option('-t, --heartbeat-timeout <ms>'
|
||||
, 'consider devices with heartbeat older than this value dead'
|
||||
, Number
|
||||
, 20000)
|
||||
.option('-i, --reap-interval <ms>'
|
||||
, 'reap interval'
|
||||
, Number
|
||||
, 10000)
|
||||
.action(function(name, options) {
|
||||
require('./units/reaper')({
|
||||
name: name
|
||||
, heartbeatTimeout: options.heartbeatTimeout
|
||||
, reapInterval: options.reapInterval
|
||||
, endpoints: {
|
||||
push: options.connectPush
|
||||
, sub: options.connectSub
|
||||
}
|
||||
})
|
||||
})
|
||||
|
@ -925,6 +929,7 @@ program
|
|||
, procutil.fork(__filename, [
|
||||
'reaper', 'reaper001'
|
||||
, '--connect-push', options.bindDevPull
|
||||
, '--connect-sub', options.bindAppPub
|
||||
])
|
||||
|
||||
// provider
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue