Skip to content

Commit d4ab9ca

Browse files
committed
Use non-routable loop back address to avoid issues with firewalls
1 parent 9a70faf commit d4ab9ca

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

exporters/otlp/testing-internal/src/main/java/io/opentelemetry/exporter/otlp/testing/internal/AbstractHttpTelemetryExporterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ void connectTimeout() {
513513
TelemetryExporter<T> exporter =
514514
exporterBuilder()
515515
// Connecting to a non-routable IP address to trigger connection error
516-
.setEndpoint("http://10.255.255.1")
516+
.setEndpoint("http://127.0.0.255")
517517
.setConnectTimeout(Duration.ofMillis(1))
518518
.build();
519519
try {

exporters/sender/jdk/src/test/java/io/opentelemetry/exporter/sender/jdk/internal/JdkHttpSenderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void setup() throws IOException, InterruptedException {
5353
sender =
5454
new JdkHttpSender(
5555
mockHttpClient,
56-
"http://10.255.255.1", // Connecting to a non-routable IP address to trigger connection
56+
"http://127.0.0.255", // Connecting to a non-routable IP address to trigger connection
5757
// timeout
5858
null,
5959
false,

exporters/sender/okhttp/src/test/java/io/opentelemetry/exporter/sender/okhttp/internal/RetryInterceptorTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ void connectTimeout() throws Exception {
148148

149149
// Connecting to a non-routable IP address to trigger connection error
150150
assertThatThrownBy(
151-
() ->
152-
client.newCall(new Request.Builder().url("http://10.255.255.1").build()).execute())
151+
() -> client.newCall(new Request.Builder().url("http://127.0.0.255").build()).execute())
153152
.isInstanceOf(SocketTimeoutException.class);
154153

155154
verify(isRetryableException, times(5)).apply(any());
@@ -165,8 +164,7 @@ void nonRetryableException() throws InterruptedException {
165164

166165
// Connecting to a non-routable IP address to trigger connection timeout
167166
assertThatThrownBy(
168-
() ->
169-
client.newCall(new Request.Builder().url("http://10.255.255.1").build()).execute())
167+
() -> client.newCall(new Request.Builder().url("http://127.0.0.255").build()).execute())
170168
.isInstanceOf(SocketTimeoutException.class);
171169

172170
verify(isRetryableException, times(1)).apply(any());

0 commit comments

Comments
 (0)