Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Commit

Permalink
fix(launcher) workers fail to launch after tunnel
Browse files Browse the repository at this point in the history
In some environments, the process which establishes the tunnel can
report that it is operational significantly before the tunnel is
actually established. This will cause subsequent calls to create a
worker to fail.

This change waits a short interval after the tunnel process has
reported itself started to allow it to actually finish establishing
the tunnel before attempting to create any workers.

Fixes #42
  • Loading branch information
aminer-looker committed Oct 20, 2015
1 parent 9995615 commit 824d524
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ 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
}
})

Expand Down

0 comments on commit 824d524

Please sign in to comment.