From ce3c78d30bde070e9fb0296a6dbcdfa761ec6c63 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 14 May 2014 22:58:46 -0700 Subject: [PATCH] Ensure tunnel stops when jobs are completed. --- test/saucelabs.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/saucelabs.js b/test/saucelabs.js index 5e1b944fb..bdccf863d 100644 --- a/test/saucelabs.js +++ b/test/saucelabs.js @@ -681,8 +681,7 @@ function Tunnel(properties) { success = !this.failed; } if (++completed == total) { - tunnel.running = false; - tunnel.emit('complete', success); + tunnel.stop(_.partial(tunnel.emit, 'complete', success)); return; } tunnel.dequeue(); @@ -874,7 +873,7 @@ var tunnel = new Tunnel({ }); tunnel.on('complete', function(success) { - this.stop(function() { process.exit(success ? 0 : 1); }); + process.exit(success ? 0 : 1); }); tunnel.start();