-
Notifications
You must be signed in to change notification settings - Fork 68
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
Add an option to write the listening port to a file #174
Conversation
Unfortunately no, it cannot: jenkinsci/jenkins-test-harness#347 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good but there is a discrepancy around charsets that the file is written in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer a command line option (Option class) but yeah not sure this will be used a lot :) )
Yes, I thought this would only be used for testing. I can turn it into an option if you prefer, but for now I wanted to see whether the whole thing was viable. |
no worries all good |
@Vlatombe looks to be ready or still a draft? |
Co-authored-by: Jesse Glick <jglick@cloudbees.com>
I want to ensure all downstream usages can be converted reasonably before considering this is ready to merge. |
Refreshed this work as unfortunately jenkinsci/jenkins-test-harness#347 is not enough to prevent port collisions. |
The context for this pull request are test flakes observed both in
RealJenkinsRule
based tests, as well as running ATH with multiple controllers launched.In both cases, a random port was generated then passed to winstone. The problem is that by the time Jetty tries to bind this port, it could become used by another instance.
This is taking another aproach:
--httpPort=0
to winstone, let Jetty allocate a random free portwinstone.portFileName
. In that case, winstone will write the used port in that file.This file can then be used by
RealJenkinsRule
or the ATH to obtain the actual port to use to access the instance.To test this change
RealJenkinsRule
tests always start on a free port jenkins-test-harness#348)