Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Randomize port #89

Closed
christiannelson opened this issue Nov 18, 2012 · 4 comments
Closed

Randomize port #89

christiannelson opened this issue Nov 18, 2012 · 4 comments

Comments

@christiannelson
Copy link
Contributor

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?

@netzpirat
Copy link
Contributor

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?

@christiannelson
Copy link
Contributor Author

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
Copy link
Contributor

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.

@christiannelson
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants