forked from akhikhl/gretty
-
Notifications
You must be signed in to change notification settings - Fork 36
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
"Use random ports" may bind to already used ports #138
Labels
kind/bug
Something isn't working
Comments
Thanks @f4lco yes a PR would be welcome. |
f4lco
added a commit
to f4lco/gretty
that referenced
this issue
Feb 3, 2020
f4lco
added a commit
to f4lco/gretty
that referenced
this issue
Feb 3, 2020
… avoid race conditions (gretty-gradle-plugin#138) API note: the server configuration "auxPortRange" is not supported any more.
f4lco
added a commit
to f4lco/gretty
that referenced
this issue
Apr 4, 2020
…ugin#147) Because gretty-gradle-plugin#138 removed adequate error handling, the check for already used ports was broken and caused Gretty to fail in case the 'gretty_ports.properties' file was present. I think the check is now obsolete because gretty-gradle-plugin#138 removed the ability to manually specify fixed service and status ports for Gretty. As a result, Gretty's ports will never clash from one Gretty invocation to the next. If the check was restored, it would only check if the previous Gretty invocation had already terminated. If one of the *servlet container ports* clashed, I deem the current behavior (BindException) sufficient.
f4lco
added a commit
to f4lco/gretty
that referenced
this issue
Apr 4, 2020
…ugin#147) Because gretty-gradle-plugin#138 removed adequate error handling, the check for already used ports was broken and caused Gretty to fail in case the 'gretty_ports.properties' file was present. I think the check is now obsolete because gretty-gradle-plugin#138 removed the ability to manually specify fixed service and status ports for Gretty. As a result, Gretty's ports will never clash from one Gretty invocation to the next. If the check was restored, it would only check if the previous Gretty invocation had already terminated. If one of the *servlet container ports* clashed, I deem the current behavior (BindException) sufficient.
This was referenced Apr 4, 2020
f4lco
added a commit
to f4lco/gretty
that referenced
this issue
Apr 13, 2020
…ugin#147) Because gretty-gradle-plugin#138 removed adequate error handling, the check for already used ports was broken and caused Gretty to fail in case the 'gretty_ports.properties' file was present. I think the check is now obsolete because gretty-gradle-plugin#138 removed the ability to manually specify fixed service and status ports for Gretty. As a result, Gretty's ports will never clash from one Gretty invocation to the next. If the check was restored, it would only check if the previous Gretty invocation had already terminated. If one of the *servlet container ports* clashed, I deem the current behavior (BindException) sufficient.
f4lco
added a commit
to f4lco/gretty
that referenced
this issue
May 3, 2020
…ugin#147) Because gretty-gradle-plugin#138 removed adequate error handling, the check for already used ports was broken and caused Gretty to fail in case the 'gretty_ports.properties' file was present. I think the check is now obsolete because gretty-gradle-plugin#138 removed the ability to manually specify fixed service and status ports for Gretty. As a result, Gretty's ports will never clash from one Gretty invocation to the next. If the check was restored, it would only check if the previous Gretty invocation had already terminated. If one of the *servlet container ports* clashed, I deem the current behavior (BindException) sufficient.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We use Gretty mainly for integration tests. We observed a test flakiness stemming from Gretty, which tried to bind already used ports when configuring the "use random ports" feature.
The analysis is as follows:
In between choosing a free port and binding it there exists a sufficient amount of time for another process to chip in and bind the same port, causing the second step to fail for one of the processes.
I think a fix consists of the following two steps:
localPort
property.I have a patch ready and I am currently testing it. Are you interested in a PR?
The text was updated successfully, but these errors were encountered: