From df3a32601a6fe311da9875a507bac532ba65bf89 Mon Sep 17 00:00:00 2001 From: Ludovic Orban Date: Mon, 30 Nov 2020 18:35:33 +0100 Subject: [PATCH] reduce test load on jenkins Signed-off-by: Ludovic Orban --- .../client/http/MaxConcurrentStreamsTest.java | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/jetty-http2/http2-http-client-transport/src/test/java/org/eclipse/jetty/http2/client/http/MaxConcurrentStreamsTest.java b/jetty-http2/http2-http-client-transport/src/test/java/org/eclipse/jetty/http2/client/http/MaxConcurrentStreamsTest.java index e294d1c9585..2bbb0b9ece4 100644 --- a/jetty-http2/http2-http-client-transport/src/test/java/org/eclipse/jetty/http2/client/http/MaxConcurrentStreamsTest.java +++ b/jetty-http2/http2-http-client-transport/src/test/java/org/eclipse/jetty/http2/client/http/MaxConcurrentStreamsTest.java @@ -37,6 +37,7 @@ import org.eclipse.jetty.client.AbstractConnectionPool; import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.client.HttpDestination; import org.eclipse.jetty.client.HttpResponseException; +import org.eclipse.jetty.client.MultiplexConnectionPool; import org.eclipse.jetty.client.api.ContentResponse; import org.eclipse.jetty.client.api.Response; import org.eclipse.jetty.client.api.Result; @@ -338,12 +339,28 @@ public class MaxConcurrentStreamsTest extends AbstractTest } }); + int parallelism = 4; + int runs = 1; + int iterations = 32; + client.setMaxConnectionsPerDestination(32768); client.setMaxRequestsQueuedPerDestination(1024 * 1024); + client.getTransport().setConnectionPoolFactory(destination -> + { + try + { + MultiplexConnectionPool pool = new MultiplexConnectionPool(destination, client.getMaxConnectionsPerDestination(), false, destination, 1); + pool.preCreateConnections(parallelism * 2).get(); + return pool; + } + catch (Exception e) + { + throw new RuntimeException(e); + } + }); + // Prime the destination to pre-create connections. + client.GET("http://localhost:" + connector.getLocalPort()); - int parallelism = 16; - int runs = 1; - int iterations = 256; int total = parallelism * runs * iterations; CountDownLatch latch = new CountDownLatch(total); Queue failures = new ConcurrentLinkedQueue<>();