From 854e366a5f79ca54687449f5edaac6a5c548e5d8 Mon Sep 17 00:00:00 2001 From: Monu Lakshkar Date: Wed, 12 Jul 2023 18:38:56 +0530 Subject: [PATCH] Fix for broken pipe issue --- .../security/httpclient5/HttpClientTest.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/instrumentation-security/httpclient-5.0/src/test/java/com/nr/instrumentation/security/httpclient5/HttpClientTest.java b/instrumentation-security/httpclient-5.0/src/test/java/com/nr/instrumentation/security/httpclient5/HttpClientTest.java index db4d4de1b..298d19fec 100644 --- a/instrumentation-security/httpclient-5.0/src/test/java/com/nr/instrumentation/security/httpclient5/HttpClientTest.java +++ b/instrumentation-security/httpclient-5.0/src/test/java/com/nr/instrumentation/security/httpclient5/HttpClientTest.java @@ -241,6 +241,8 @@ public void callExecute() throws URISyntaxException, IOException { try (CloseableHttpClient httpclient = HttpClients.createDefault()) { HttpGet httpGet = new HttpGet(server.getEndPoint().toString()); httpclient.execute(httpGet); + Thread.sleep(100); + } catch (InterruptedException e) { } } @@ -250,6 +252,8 @@ public void callExecute1() throws URISyntaxException, IOException { HttpGet httpGet = new HttpGet(server.getEndPoint().toString()); HttpContext httpContext = new BasicHttpContext(); httpclient.execute(httpGet, httpContext); + Thread.sleep(100); + } catch (InterruptedException e) { } } @@ -259,6 +263,8 @@ public void callExecute2() throws URISyntaxException, IOException { HttpHost httpHost = new HttpHost(server.getEndPoint().getScheme(), server.getEndPoint().getHost(), server.getEndPoint().getPort()); HttpGet httpGet = new HttpGet(server.getEndPoint().toString()); httpclient.execute(httpHost, httpGet); + Thread.sleep(100); + } catch (InterruptedException e) { } } @@ -269,6 +275,8 @@ public void callExecute3() throws URISyntaxException, IOException { HttpGet httpGet = new HttpGet(server.getEndPoint().toString()); HttpContext httpContext = new BasicHttpContext(); httpclient.execute(httpHost, httpGet, httpContext); + Thread.sleep(100); + } catch (InterruptedException e) { } } @@ -278,6 +286,8 @@ public void callExecute4() throws Exception { HttpGet httpGet = new HttpGet(server.getEndPoint().toString()); HttpClientResponseHandler responseHandler = new BasicHttpClientResponseHandler(); httpclient.execute(httpGet, responseHandler); + Thread.sleep(100); + } catch (InterruptedException e) { } } @@ -288,6 +298,8 @@ public void callExecute5() throws Exception { HttpClientResponseHandler responseHandler = new BasicHttpClientResponseHandler(); HttpContext httpContext = new BasicHttpContext(); httpclient.execute(httpGet, httpContext, responseHandler); + Thread.sleep(100); + } catch (InterruptedException e) { } } @@ -298,6 +310,8 @@ public void callExecute6() throws Exception { HttpClientResponseHandler responseHandler = new BasicHttpClientResponseHandler(); HttpHost httpHost = new HttpHost(server.getEndPoint().getScheme(), server.getEndPoint().getHost(), server.getEndPoint().getPort()); httpclient.execute(httpHost, httpGet, responseHandler); + Thread.sleep(100); + } catch (InterruptedException e) { } } @@ -309,6 +323,8 @@ public void callExecute7() throws Exception { HttpHost httpHost = new HttpHost(server.getEndPoint().getScheme(), server.getEndPoint().getHost(), server.getEndPoint().getPort()); HttpContext httpContext = new BasicHttpContext(); httpclient.execute(httpHost, httpGet, httpContext, responseHandler); + Thread.sleep(100); + } catch (InterruptedException e) { } } }