You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "elharo (via GitHub)" <gi...@apache.org> on 2026/08/05 14:01:12 UTC
[PR] Fix flaky JettyTransporterTest.testGet_HTTP3 (UDP port collision) [maven-resolver]
elharo opened a new pull request, #2037:
URL: https://github.com/apache/maven-resolver/pull/2037
Fixes #2036
## Problem
`JettyTransporterTest.testGet_HTTP3` is flaky: binding the HTTP/3 (UDP) connector to the HTTPS TCP connector's port fails with `java.net.BindException: Address already in use`.
## Root cause
The test bound both connectors to the same numeric port by reusing `getHttpsPort()`, which is an OS-assigned *TCP* port. TCP and UDP port spaces are allocated independently, so the same-numbered *UDP* port may already be in use by another process. The collision is inherent to the "let the OS pick a TCP port, then force UDP onto the same number" pattern (verified by experiment: ~1% collision rate with a few hundred UDP sockets occupied).
## Fix
- Added `HttpServer.findFreeTcpAndUdpPort()`, which probes for a port that is free for **both** TCP and UDP.
- Added `HttpServer.addHttp2OnlyConnectorWithMutualTLS(int port)` so the HTTPS (HTTP/2) connector can be bound to that exact port.
- `testGet_HTTP3` now reserves such a port and binds both connectors to it, keeping the intended "HTTP/2 and HTTP/3 on the same port" semantics.
Verified: `JettyTransporterTest` (89 tests), `ApacheTransporterTest` (93), and `JdkTransporterTest` (92) all pass; the HTTP/3 requests in `testGet_HTTP3` are served over HTTP/3.0.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Deflake JettyTransporterTest.testGet_HTTP3 (UDP port collision) [maven-resolver]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #2037:
URL: https://github.com/apache/maven-resolver/pull/2037#issuecomment-5195821939
@elharo Please assign appropriate label to PR according to the type of change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Deflake JettyTransporterTest.testGet_HTTP3 (UDP port collision) [maven-resolver]
Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo merged PR #2037:
URL: https://github.com/apache/maven-resolver/pull/2037
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org