This is an automated email from the ASF dual-hosted git repository.
kwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-resolver.git
The following commit(s) were added to refs/heads/master by this push:
new f97423550 Do not check UrlTransporter for open connections after close
f97423550 is described below
commit f97423550e975bd555833926b6fec60712463e56
Author: Konrad Windszus <[email protected]>
AuthorDate: Sat Jul 18 11:43:18 2026 +0200
Do not check UrlTransporter for open connections after close
Connection pooling for HttpUrlTransporter is managed by JRE with
no way to explicitly close idle connections
(compare with
https://docs.oracle.com/javase/6/docs/technotes/guides/net/http-keepalive.html)
---
.../internal/test/util/http/HttpTransporterTest.java | 14 ++++++++++++--
.../eclipse/aether/transport/url/UrlTransporterTest.java | 11 +++++++++++
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git
a/maven-resolver-test-http/src/main/java/org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java
b/maven-resolver-test-http/src/main/java/org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java
index 46d9e6afb..f0d54e491 100644
---
a/maven-resolver-test-http/src/main/java/org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java
+++
b/maven-resolver-test-http/src/main/java/org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java
@@ -307,8 +307,10 @@ public abstract class HttpTransporterTest {
closer = null;
}
if (httpServer != null) {
- // check for leaked connections (e.g., due to not closing response
body streams)
- Awaitility.await().atMost(5, TimeUnit.SECONDS).until(() ->
httpServer.getNumConnectedEndPoints() == 0);
+ if (closesAllConnectionsOnTransporterClose()) {
+ // check for leaked connections (e.g., due to not closing
response body streams)
+ Awaitility.await().atMost(3, TimeUnit.SECONDS).until(() ->
httpServer.getNumConnectedEndPoints() == 0);
+ }
httpServer.stop();
httpServer = null;
}
@@ -316,6 +318,14 @@ public abstract class HttpTransporterTest {
session = null;
}
+ /**
+ * Indicates whether the transporter implementation closes all connections
when the transporter is closed.
+ * @return {@code true} if all connections are closed on transporter
close, {@code false} otherwise.
+ */
+ protected boolean closesAllConnectionsOnTransporterClose() {
+ return true;
+ }
+
/**
* Indicates whether the transporter implementation supports preemptive
authentication (i.e., sending credentials with the first request).
* @return {@code true} if preemptive authentication is supported, {@code
false} otherwise.
diff --git
a/maven-resolver-transport-url/src/test/java/org/eclipse/aether/transport/url/UrlTransporterTest.java
b/maven-resolver-transport-url/src/test/java/org/eclipse/aether/transport/url/UrlTransporterTest.java
index 81b64e0ea..9ad82d26e 100644
---
a/maven-resolver-transport-url/src/test/java/org/eclipse/aether/transport/url/UrlTransporterTest.java
+++
b/maven-resolver-transport-url/src/test/java/org/eclipse/aether/transport/url/UrlTransporterTest.java
@@ -34,6 +34,12 @@ class UrlTransporterTest extends HttpTransporterTest {
super(() -> new UrlTransporterFactory(standardChecksumExtractor(), new
PathProcessorSupport()));
}
+ @Override
+ protected boolean closesAllConnectionsOnTransporterClose() {
+ // compare with
https://docs.oracle.com/javase/6/docs/technotes/guides/net/http-keepalive.html
+ return false;
+ }
+
@Override
protected Stream<String> supportedCompressionAlgorithms() {
return Stream.of("gzip", "deflate");
@@ -204,6 +210,11 @@ class UrlTransporterTest extends HttpTransporterTest {
@Test
protected void testPut_Unauthenticated() {}
+ @Override
+ @Disabled("PUT unsupported")
+ @Test
+ protected void testPut_WithResponseBody() {}
+
@Override
@Disabled
@Test