diff --git a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/StressTest.java b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/StressTest.java index 2b6c9d9691a..ed43c080c79 100644 --- a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/StressTest.java +++ b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/StressTest.java @@ -21,7 +21,6 @@ import java.util.ArrayList; import java.util.List; -import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -35,7 +34,6 @@ import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.internal.guava.ThreadFactoryBuilder; -import org.glassfish.jersey.jdk.connector.JdkConnectorProperties; import org.glassfish.jersey.jdk.connector.JdkConnectorProvider; import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.test.JerseyTest; @@ -44,29 +42,15 @@ public class StressTest extends JerseyTest { - private static final int PARALLELISM = 10; - private static final int IDLE_TIMEOUT = 50; + private static final int PARALLELISM = 50; private static final int ITERATIONS = 1000; - private static CountDownLatch requests; - private static CountDownLatch latch; @Path("/test") public static class TestResource { - @GET - @Path("/1") - public String test1() throws InterruptedException { - requests.countDown(); - if (latch.await(10, TimeUnit.SECONDS)) { - return "test1"; - } else { - throw new IllegalStateException("Timeout"); - } - } @GET - @Path("/2") - public String test2() { - return "test2"; + public String test() { + return "test"; } } @@ -79,33 +63,9 @@ protected Application configure() { @Override protected void configureClient(ClientConfig config) { - config.property(JdkConnectorProperties.MAX_CONNECTIONS_PER_DESTINATION, PARALLELISM); - config.property(JdkConnectorProperties.CONNECTION_IDLE_TIMEOUT, IDLE_TIMEOUT); config.connectorProvider(new JdkConnectorProvider()); } - @Test - public void hangAllRequestsStatus200() throws InterruptedException, ExecutionException { - ExecutorService executor = Executors.newFixedThreadPool(PARALLELISM, - new ThreadFactoryBuilder().setNameFormat("client-%d").build()); - for (int i = 0; i < ITERATIONS; i++) { - requests = new CountDownLatch(PARALLELISM); - latch = new CountDownLatch(1); - List> responses = new ArrayList<>(); - for (int j = 0; j < PARALLELISM; j++) { - Future future = executor.submit(() -> target("/test/1").request().get()); - responses.add(future); - } - assertTrue(requests.await(20, TimeUnit.SECONDS)); - latch.countDown(); - for (Future response : responses) { - assertEquals(200, response.get().getStatus()); - } - } - executor.shutdown(); - assertTrue(executor.awaitTermination(10, TimeUnit.SECONDS)); - } - @Test public void randomnessStatus200() throws InterruptedException, ExecutionException { ExecutorService executor = Executors.newFixedThreadPool(PARALLELISM, @@ -114,7 +74,7 @@ public void randomnessStatus200() throws InterruptedException, ExecutionExceptio System.out.println("Iteration " + i); List> responses = new ArrayList<>(); for (int j = 0; j < 100; j++) { - Future future = executor.submit(() -> target("/test/2").request().get()); + Future future = executor.submit(() -> target("/test").request().get()); responses.add(future); } for (Future response : responses) { @@ -124,16 +84,4 @@ public void randomnessStatus200() throws InterruptedException, ExecutionExceptio executor.shutdown(); assertTrue(executor.awaitTermination(10, TimeUnit.SECONDS)); } - - @Test - public void syncTest() { - Response response = target("/test/2").request().get(); - assertEquals(200, response.getStatus()); - } - - @Test - public void asyncTest() throws InterruptedException, ExecutionException { - Future response = target("/test/2").request().async().get(); - assertEquals(200, response.get().getStatus()); - } } diff --git a/etc/jenkins/jenkins_build.sh b/etc/jenkins/jenkins_build.sh index afa8b1584e5..246e2512bdb 100644 --- a/etc/jenkins/jenkins_build.sh +++ b/etc/jenkins/jenkins_build.sh @@ -2,4 +2,4 @@ export DEBUG=true -mvn -V -U -B -e clean install glassfish-copyright:check -Dcopyright.quiet=false -Dsurefire.systemPropertiesFile=${WORKSPACE}/etc/jenkins/systemPropertiesFile \ No newline at end of file +mvn -X -V -U -B -e clean install glassfish-copyright:check -Dcopyright.quiet=false -Dsurefire.systemPropertiesFile=${WORKSPACE}/etc/jenkins/systemPropertiesFile \ No newline at end of file