diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/testing/src/main/groovy/JaxRsHttpServerTest.groovy b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/testing/src/main/groovy/JaxRsHttpServerTest.groovy index e01ef29f63..97391da68a 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/testing/src/main/groovy/JaxRsHttpServerTest.groovy +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/testing/src/main/groovy/JaxRsHttpServerTest.groovy @@ -8,6 +8,11 @@ import test.JaxRsTestResource abstract class JaxRsHttpServerTest extends AbstractJaxRsHttpServerTest { + def setup() { + // reset the barrier to avoid a failing test breaking subsequent tests + JaxRsTestResource.BARRIER.reset() + } + @Override void awaitBarrier(int amount, TimeUnit timeUnit) { JaxRsTestResource.BARRIER.await(amount, timeUnit) diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/testing/src/main/groovy/test/JaxRsTestResource.groovy b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/testing/src/main/groovy/test/JaxRsTestResource.groovy index f72f132e12..92b3ae286d 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/testing/src/main/groovy/test/JaxRsTestResource.groovy +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/testing/src/main/groovy/test/JaxRsTestResource.groovy @@ -119,7 +119,7 @@ class JaxRsTestResource { void asyncOp(@Suspended AsyncResponse response, @QueryParam("action") String action) { CompletableFuture.runAsync({ // await for the test method to verify that there are no spans yet - BARRIER.await(1, SECONDS) + BARRIER.await(10, SECONDS) switch (action) { case "succeed": @@ -144,7 +144,7 @@ class JaxRsTestResource { def result = new CompletableFuture() CompletableFuture.runAsync({ // await for the test method to verify that there are no spans yet - BARRIER.await(1, SECONDS) + BARRIER.await(10, SECONDS) switch (action) { case "succeed": diff --git a/instrumentation/jaxrs/jaxrs-3.0/jaxrs-3.0-common/testing/src/main/groovy/JaxRsHttpServerTest.groovy b/instrumentation/jaxrs/jaxrs-3.0/jaxrs-3.0-common/testing/src/main/groovy/JaxRsHttpServerTest.groovy index e01ef29f63..97391da68a 100644 --- a/instrumentation/jaxrs/jaxrs-3.0/jaxrs-3.0-common/testing/src/main/groovy/JaxRsHttpServerTest.groovy +++ b/instrumentation/jaxrs/jaxrs-3.0/jaxrs-3.0-common/testing/src/main/groovy/JaxRsHttpServerTest.groovy @@ -8,6 +8,11 @@ import test.JaxRsTestResource abstract class JaxRsHttpServerTest extends AbstractJaxRsHttpServerTest { + def setup() { + // reset the barrier to avoid a failing test breaking subsequent tests + JaxRsTestResource.BARRIER.reset() + } + @Override void awaitBarrier(int amount, TimeUnit timeUnit) { JaxRsTestResource.BARRIER.await(amount, timeUnit) diff --git a/instrumentation/jaxrs/jaxrs-3.0/jaxrs-3.0-common/testing/src/main/groovy/test/JaxRsTestResource.groovy b/instrumentation/jaxrs/jaxrs-3.0/jaxrs-3.0-common/testing/src/main/groovy/test/JaxRsTestResource.groovy index e01f4802e6..b069ad5077 100644 --- a/instrumentation/jaxrs/jaxrs-3.0/jaxrs-3.0-common/testing/src/main/groovy/test/JaxRsTestResource.groovy +++ b/instrumentation/jaxrs/jaxrs-3.0/jaxrs-3.0-common/testing/src/main/groovy/test/JaxRsTestResource.groovy @@ -118,7 +118,7 @@ class JaxRsTestResource { void asyncOp(@Suspended AsyncResponse response, @QueryParam("action") String action) { CompletableFuture.runAsync({ // await for the test method to verify that there are no spans yet - BARRIER.await(1, SECONDS) + BARRIER.await(10, SECONDS) switch (action) { case "succeed": @@ -143,7 +143,7 @@ class JaxRsTestResource { def result = new CompletableFuture() CompletableFuture.runAsync({ // await for the test method to verify that there are no spans yet - BARRIER.await(1, SECONDS) + BARRIER.await(10, SECONDS) switch (action) { case "succeed": diff --git a/instrumentation/jaxrs/jaxrs-common/testing/src/main/groovy/AbstractJaxRsHttpServerTest.groovy b/instrumentation/jaxrs/jaxrs-common/testing/src/main/groovy/AbstractJaxRsHttpServerTest.groovy index c290e0e303..8cac640b43 100644 --- a/instrumentation/jaxrs/jaxrs-common/testing/src/main/groovy/AbstractJaxRsHttpServerTest.groovy +++ b/instrumentation/jaxrs/jaxrs-common/testing/src/main/groovy/AbstractJaxRsHttpServerTest.groovy @@ -129,7 +129,7 @@ abstract class AbstractJaxRsHttpServerTest extends HttpServerTest implemen } when: "barrier is released and resource class sends response" - awaitBarrier(1, SECONDS) + awaitBarrier(10, SECONDS) def response = futureResponse.join() then: @@ -172,7 +172,7 @@ abstract class AbstractJaxRsHttpServerTest extends HttpServerTest implemen } when: "barrier is released and resource class sends response" - awaitBarrier(1, SECONDS) + awaitBarrier(10, SECONDS) def response = futureResponse.join() then: