diff --git a/index.js b/index.js index 7b22457..b31070e 100644 --- a/index.js +++ b/index.js @@ -38,14 +38,16 @@ var createBrowserStackTunnel = function (logger, config, emitter) { log.error('Can not establish the tunnel.\n%s', error.toString()) deferred.reject(error) } else { - log.debug('Tunnel established.') - deferred.resolve() + setTimeout(function() { + log.debug('Tunnel established.') + deferred.resolve() + }, 2000) // Give the tunnel time to become actually established } }) emitter.on('exit', function (done) { log.debug('Shutting down the tunnel.') - tunnel.stop(function (error) { + tunnel.stop(function(error) { if (error) { log.error(error) }