Skip to content

Commit 176b997

Browse files
authored
Add timeout to apache http client 5 async test (#12336)
1 parent 72b6e2c commit 176b997

File tree

1 file changed

+2
-1
lines changed
  • instrumentation/apache-httpclient/apache-httpclient-5.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/apachehttpclient/v5_0

1 file changed

+2
-1
lines changed

instrumentation/apache-httpclient/apache-httpclient-5.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/apachehttpclient/v5_0/ApacheHttpAsyncClientTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import java.net.URI;
1313
import java.util.Map;
1414
import java.util.concurrent.CancellationException;
15+
import java.util.concurrent.TimeUnit;
1516
import org.apache.hc.client5.http.async.methods.SimpleHttpRequest;
1617
import org.apache.hc.client5.http.async.methods.SimpleHttpResponse;
1718
import org.apache.hc.client5.http.config.RequestConfig;
@@ -114,7 +115,7 @@ public SimpleHttpRequest buildRequest(String method, URI uri, Map<String, String
114115

115116
@Override
116117
HttpResponse executeRequest(SimpleHttpRequest request, URI uri) throws Exception {
117-
return client.execute(request, getContext(), null).get();
118+
return client.execute(request, getContext(), null).get(30, TimeUnit.SECONDS);
118119
}
119120

120121
@Override

0 commit comments

Comments
 (0)