Skip to content

Commit ea565dc

Browse files
committed
Revert to using a fixed host/address for the connect instance due to multiple port allocation issues on GH actions
1 parent 78e0dc2 commit ea565dc

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafka/EmbeddedKafkaService.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import java.util.concurrent.TimeUnit;
2424

2525
import org.apache.camel.kafkaconnector.common.PluginPathHelper;
26-
import org.apache.camel.kafkaconnector.common.utils.NetworkUtils;
2726
import org.apache.camel.test.infra.kafka.services.KafkaService;
2827
import org.apache.kafka.connect.runtime.WorkerConfig;
2928
import org.apache.kafka.connect.util.clusters.EmbeddedConnectCluster;
@@ -52,7 +51,7 @@ private void buildCluster() {
5251
Map<String, String> workerProps = new HashMap<>();
5352
workerProps.put(WorkerConfig.OFFSET_COMMIT_INTERVAL_MS_CONFIG, String.valueOf(OFFSET_COMMIT_INTERVAL_MS));
5453

55-
String address = NetworkUtils.getAddress("http");
54+
String address = "http://localhost:9999";
5655
LOG.info("Using the following address for the listener configuration: {}", address);
5756
workerProps.put(WorkerConfig.LISTENERS_CONFIG, address);
5857

tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/utils/NetworkUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public enum Protocol {
122122
public static String getHostname() {
123123
if (hostname == null) {
124124
try {
125-
hostname = InetAddress.getLocalHost().getCanonicalHostName();
125+
hostname = InetAddress.getLocalHost().getHostName();
126126
} catch (UnknownHostException e) {
127127
LOG.warn("Will default to 'localhost' because the code could not get the local hostname: {}",
128128
e.getMessage(), e);

0 commit comments

Comments
 (0)