Increase timeout, make test more resilient to failures (#10867)

This commit is contained in:
Lauri Tulmin 2024-03-15 15:11:44 +02:00 committed by GitHub
parent 0b0789abdd
commit f4d2f28b98
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 16 additions and 6 deletions

View File

@ -8,6 +8,11 @@ import test.JaxRsTestResource
abstract class JaxRsHttpServerTest<S> extends AbstractJaxRsHttpServerTest<S> {
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)

View File

@ -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<String>()
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":

View File

@ -8,6 +8,11 @@ import test.JaxRsTestResource
abstract class JaxRsHttpServerTest<S> extends AbstractJaxRsHttpServerTest<S> {
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)

View File

@ -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<String>()
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":

View File

@ -129,7 +129,7 @@ abstract class AbstractJaxRsHttpServerTest<S> extends HttpServerTest<S> 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<S> extends HttpServerTest<S> implemen
}
when: "barrier is released and resource class sends response"
awaitBarrier(1, SECONDS)
awaitBarrier(10, SECONDS)
def response = futureResponse.join()
then: