You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2026/07/07 13:55:32 UTC

(cxf) branch coheigea/test-ports created (now f91d054a760)

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

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


      at f91d054a760 Set setReuseAddress on the test socket to try to reduce port conflicts

This branch includes the following new commits:

     new f91d054a760 Set setReuseAddress on the test socket to try to reduce port conflicts

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(cxf) 01/01: Set setReuseAddress on the test socket to try to reduce port conflicts

Posted by co...@apache.org.
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 <co...@apache.org>
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);