This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch coheigea/test-ports
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit f91d054a760ad78aeb9dc7e83435a2a954cb63eb
Author: Colm O hEigeartaigh <[email protected]>
AuthorDate: Tue Jul 7 14:54:42 2026 +0100

    Set setReuseAddress on the test socket to try to reduce port conflicts
---
 testutils/src/main/java/org/apache/cxf/testutil/common/TestUtil.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/testutils/src/main/java/org/apache/cxf/testutil/common/TestUtil.java 
b/testutils/src/main/java/org/apache/cxf/testutil/common/TestUtil.java
index fad15c17f5f..859d1208933 100644
--- a/testutils/src/main/java/org/apache/cxf/testutil/common/TestUtil.java
+++ b/testutils/src/main/java/org/apache/cxf/testutil/common/TestUtil.java
@@ -198,6 +198,8 @@ public final class TestUtil {
         while (p == null) {
             int pn = portNum++;
             try (ServerSocket sock = new ServerSocket(pn)) {
+                // Enable SO_REUSEADDR to allow faster port reuse after socket 
closure
+                sock.setReuseAddress(true);
                 //make sure the port can be opened.   Something MIGHT be 
running on it.
                 p = Integer.toString(pn);
                 LOG.fine("Setting port for " + fullName + " to " + p);

Reply via email to