From 97f4fd1c21f579455950010aba5d318655b68751 Mon Sep 17 00:00:00 2001 From: Lauri Tulmin Date: Tue, 23 Nov 2021 20:30:45 +0200 Subject: [PATCH] Enable read timeout test for HttpURLConnection (#4699) --- .../src/test/groovy/HttpUrlConnectionTest.groovy | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/instrumentation/http-url-connection/javaagent/src/test/groovy/HttpUrlConnectionTest.groovy b/instrumentation/http-url-connection/javaagent/src/test/groovy/HttpUrlConnectionTest.groovy index 83f610a4b9ee..11851435a917 100644 --- a/instrumentation/http-url-connection/javaagent/src/test/groovy/HttpUrlConnectionTest.groovy +++ b/instrumentation/http-url-connection/javaagent/src/test/groovy/HttpUrlConnectionTest.groovy @@ -27,6 +27,9 @@ class HttpUrlConnectionTest extends HttpClientTest implements @Override int sendRequest(HttpURLConnection connection, String method, URI uri, Map 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 implements return false } + @Override + boolean testReadTimeout() { + true + } + @Unroll def "trace request (useCaches: #useCaches)"() { setup: