[
https://issues.apache.org/jira/browse/SUREFIRE-2220?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17794880#comment-17794880
]
ASF GitHub Bot commented on SUREFIRE-2220:
--
michael-o opened a new pull request, #697:
URL: https://github.com/apache/maven-surefire/pull/697
…urns invalid URI string if localHost resolves to IPv6 address
This closes #697
Following this checklist to help us incorporate your
contribution quickly and easily:
- [ ] Make sure there is a [JIRA
issue](https://issues.apache.org/jira/browse/SUREFIRE) filed
for the change (usually before you start working on it). Trivial
changes like typos do not
require a JIRA issue. Your pull request should address just this
issue, without
pulling in other changes.
- [ ] Each commit in the pull request should have a meaningful subject line
and body.
- [ ] Format the pull request title like `[SUREFIRE-XXX] - Fixes bug in
ApproximateQuantiles`,
where you replace `SUREFIRE-XXX` with the appropriate JIRA issue.
Best practice
is to use the JIRA issue title in the pull request title and in the
first line of the
commit message.
- [ ] Write a pull request description that is detailed enough to
understand what the pull request does, how, and why.
- [ ] Run `mvn clean install` to make sure basic checks pass. A more
thorough check will
be performed on your pull request automatically.
- [ ] You have run the integration tests successfully (`mvn -Prun-its clean
install`).
If your pull request is about ~20 lines of code you don't need to sign an
[Individual Contributor License
Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the [Apache License Version 2.0, January
2004](http://www.apache.org/licenses/LICENSE-2.0)
you have to acknowledge this by using the following check-box.
- [ ] I hereby declare this contribution to be licenced under the [Apache
License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
- [ ] In any other case, please file an [Apache Individual Contributor
License Agreement](https://www.apache.org/licenses/icla.pdf).
> SurefireForkChannel#getForkNodeConnectionString() returns invalid URI string
> if localHost resolves to IPv6 address
> --
>
> Key: SUREFIRE-2220
> URL: https://issues.apache.org/jira/browse/SUREFIRE-2220
> Project: Maven Surefire
> Issue Type: Bug
> Components: process forking
>Affects Versions: 3.2.2
>Reporter: Lutz Neugebauer
>Assignee: Michael Osipov
>Priority: Major
> Fix For: 3.2.3
>
>
> [SurefireForkChannel.getForkNodeConnectionString|https://github.com/apache/maven-surefire/blob/2d7675397e884b18d59a596c004e73982368ee7c/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/SurefireForkChannel.java#L114]
> returns invalid URI string if localhost is an IPv6 address literal:
> {code:java}
> public String getForkNodeConnectionString() {
> return "tcp://" + localHost + ":" + localPort + (isBlank(sessionId) ?
> "" : "?sessionId=" + sessionId);
> } {code}
> localHost is initialized from
> [InetSocketAddress.getHostString()|https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/net/InetSocketAddress.html#getHostString()]
> at
> [SurefireForkChannel.SurefireForkChannel()|https://github.com/apache/maven-surefire/blob/2d7675397e884b18d59a596c004e73982368ee7c/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/SurefireForkChannel.java#L100]
> which may return "... the String form of the address if it doesn't have a
> hostname (it was created using a literal)."
> If an IPv6 address is returned, then the URI computed is something like
> {code:java}
> tcp://0:0:0:0:0:0:0:1:34398?sessionId=... {code}
> instead of required format (cf.
> [URI.URI()|https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/net/URI.html#%3Cinit%3E(java.lang.String])
> {code:java}
> tcp://[0:0:0:0:0:0:0:1]:34398?sessionId=... {code}
> At my end the incorrect URI seems to cause hanging build, probably when it is
> consumed at
> [SurefireMasterProcessChannelProcessorFactory.connect()|https://github.com/apache/maven-surefire/blob/2d7675397e884b18d59a596c004e73982368ee7c/surefire-booter/src/main/java/org/apache/maven/surefire/booter/spi/SurefireMasterProcessChannelProcessorFactory.java#L74].
--
This message was sent by Atlassian Jira
(v8.20.10#820010)