This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cxf.git
The following commit(s) were added to refs/heads/main by this push:
new d8009cd9593 Set setReuseAddress on the test socket to try to reduce
port conflicts (#3290)
d8009cd9593 is described below
commit d8009cd959308d0448705d3d46621758fe4b37c1
Author: Colm O hEigeartaigh <[email protected]>
AuthorDate: Wed Jul 8 09:51:53 2026 +0100
Set setReuseAddress on the test socket to try to reduce port conflicts
(#3290)
---
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);