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

fmariani pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kafka-connector.git

commit 31d263ecdba3767403d5de3052e9da679449d422
Author: Croway <[email protected]>
AuthorDate: Fri Apr 3 12:55:43 2026 +0200

    chore: avoid ephemeral port range on macOS to fix test port conflicts
    
    On macOS the OS ephemeral port range starts at 49152, which is the same
    as DEFAULT_STARTING_PORT. This caused race conditions where OS-assigned
    ports (e.g. from Kafka clients) would collide with test-reserved ports,
    leading to BindException in sink tests and message delivery failures
    in source tests. Use port 20000 as starting port on macOS to avoid
    the ephemeral range.
---
 .../java/org/apache/camel/kafkaconnector/common/utils/NetworkUtils.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/utils/NetworkUtils.java
 
b/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/utils/NetworkUtils.java
index 99ab59750a..216ddd7d63 100644
--- 
a/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/utils/NetworkUtils.java
+++ 
b/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/utils/NetworkUtils.java
@@ -30,7 +30,7 @@ import org.slf4j.LoggerFactory;
 public final class NetworkUtils {
     
     public static final int  DEFAULT_ENDING_PORT = 65535;
-    public static final int  DEFAULT_STARTING_PORT = 49152;
+    public static final int  DEFAULT_STARTING_PORT = 
System.getProperty("os.name", "").toLowerCase().contains("mac") ? 20000 : 49152;
     public static int freeStartingPort = DEFAULT_STARTING_PORT;
     private static final Logger LOG = 
LoggerFactory.getLogger(NetworkUtils.class);
 

Reply via email to