Enable read timeout test for HttpURLConnection
MODIFY
instrumentation/http-url-connection/javaagent/src/test/groovy/HttpUrlConnectionTest.groovy
instrumentation/http-url-connection/javaagent/src/test/groovy/HttpUrlConnectionTest.groovy
@@ -27,6 +27,9 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpURLConnection> implements
@Override
int sendRequest(HttpURLConnection connection, String method, URI uri, Map<String, String> headers) {
+ if (uri.toString().contains("/read-timeout")) {
+ connection.readTimeout = READ_TIMEOUT_MS
+ }
try {
connection.setRequestMethod(method)
headers.each { connection.setRequestProperty(it.key, it.value) }
@@ -65,6 +68,11 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpURLConnection> implements
return false
}
+ @Override
+ boolean testReadTimeout() {
+ true
+ }
+
@Unroll
def "trace request (useCaches: #useCaches)"() {
setup:

Enable read timeout test for HttpURLConnection (#4699)