Randomize port #89

christiannelson opened this Issue Nov 18, 2012 · 4 comments


None yet

2 participants


We're starting to use guard-jasmine on multiple projects, all of which are running on the same CI instance. When two builds run at the same time we see intermittent failures because of port collisions.

Have you considered randomizing the port that's used?


Even with randomized ports there's still a possibility that two different builds pick the same port. Why not simply specify a fixed, different port for each project on the CI?


Sure it's possible to have a collision with a random port, but it's pretty unlikely. Most of the time the port is not strictly random. A short check to ensure the port is free saves us from conflicts (see https://github.com/johnbintz/jasmine-headless-webkit/blob/master/lib/jasmine/headless/runner.rb#L50-L77 as an example). We never had a collision using JHW and we regularly had 12-20 projects on a machine integrating with a concurrency of 3-4. We're migrating to guard-jasmine (and friends) from JHW because it's better supported.

It's nice to be able to use guard-jasmine out of the box without having to pick a unique port and hardcode it in the project's configuration. This feature request is in the spirit of my last, which was to autodetect your app server instead of defaulting to webrick (#82). Why configure something when a better solution exists that doesn't require configuration?

@netzpirat netzpirat closed this in 0c07157 Nov 19, 2012

Agree. Randomizing the server port makes guard-jasmine handle concurrent builds on the same box work out of the box. Version 1.10.0 released.



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment