1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 10:19:30 +02:00

Allocated ports were not being released properly due to fork() now consuming the ports. Additionally fixes port pool grouping. Fixes #138.

This commit is contained in:
Simo Kinnunen 2015-10-21 16:58:41 +09:00
parent 4dc8772e1b
commit 396cfbad7f

View file

@ -31,7 +31,7 @@ module.exports = function(options) {
// port, we must ensure that we allocate ports in fixed groups. // port, we must ensure that we allocate ports in fixed groups.
var ports = options.ports.slice( var ports = options.ports.slice(
0 0
, options.ports.length - options.ports.length % 2 , options.ports.length - options.ports.length % 4
) )
// Information about total devices // Information about total devices
@ -317,7 +317,7 @@ module.exports = function(options) {
// Spawn a device worker // Spawn a device worker
function spawn() { function spawn() {
var allocatedPorts = ports.splice(0, 4) var allocatedPorts = ports.splice(0, 4)
, proc = options.fork(device, allocatedPorts) , proc = options.fork(device, allocatedPorts.slice())
, resolver = Promise.defer() , resolver = Promise.defer()
function exitListener(code, signal) { function exitListener(code, signal) {