Increase timeout, make test more resilient to failures (#10867)
This commit is contained in:
parent
0b0789abdd
commit
f4d2f28b98
|
@ -8,6 +8,11 @@ import test.JaxRsTestResource
|
||||||
|
|
||||||
abstract class JaxRsHttpServerTest<S> extends AbstractJaxRsHttpServerTest<S> {
|
abstract class JaxRsHttpServerTest<S> extends AbstractJaxRsHttpServerTest<S> {
|
||||||
|
|
||||||
|
def setup() {
|
||||||
|
// reset the barrier to avoid a failing test breaking subsequent tests
|
||||||
|
JaxRsTestResource.BARRIER.reset()
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
void awaitBarrier(int amount, TimeUnit timeUnit) {
|
void awaitBarrier(int amount, TimeUnit timeUnit) {
|
||||||
JaxRsTestResource.BARRIER.await(amount, timeUnit)
|
JaxRsTestResource.BARRIER.await(amount, timeUnit)
|
||||||
|
|
|
@ -119,7 +119,7 @@ class JaxRsTestResource {
|
||||||
void asyncOp(@Suspended AsyncResponse response, @QueryParam("action") String action) {
|
void asyncOp(@Suspended AsyncResponse response, @QueryParam("action") String action) {
|
||||||
CompletableFuture.runAsync({
|
CompletableFuture.runAsync({
|
||||||
// await for the test method to verify that there are no spans yet
|
// await for the test method to verify that there are no spans yet
|
||||||
BARRIER.await(1, SECONDS)
|
BARRIER.await(10, SECONDS)
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case "succeed":
|
case "succeed":
|
||||||
|
@ -144,7 +144,7 @@ class JaxRsTestResource {
|
||||||
def result = new CompletableFuture<String>()
|
def result = new CompletableFuture<String>()
|
||||||
CompletableFuture.runAsync({
|
CompletableFuture.runAsync({
|
||||||
// await for the test method to verify that there are no spans yet
|
// await for the test method to verify that there are no spans yet
|
||||||
BARRIER.await(1, SECONDS)
|
BARRIER.await(10, SECONDS)
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case "succeed":
|
case "succeed":
|
||||||
|
|
|
@ -8,6 +8,11 @@ import test.JaxRsTestResource
|
||||||
|
|
||||||
abstract class JaxRsHttpServerTest<S> extends AbstractJaxRsHttpServerTest<S> {
|
abstract class JaxRsHttpServerTest<S> extends AbstractJaxRsHttpServerTest<S> {
|
||||||
|
|
||||||
|
def setup() {
|
||||||
|
// reset the barrier to avoid a failing test breaking subsequent tests
|
||||||
|
JaxRsTestResource.BARRIER.reset()
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
void awaitBarrier(int amount, TimeUnit timeUnit) {
|
void awaitBarrier(int amount, TimeUnit timeUnit) {
|
||||||
JaxRsTestResource.BARRIER.await(amount, timeUnit)
|
JaxRsTestResource.BARRIER.await(amount, timeUnit)
|
||||||
|
|
|
@ -118,7 +118,7 @@ class JaxRsTestResource {
|
||||||
void asyncOp(@Suspended AsyncResponse response, @QueryParam("action") String action) {
|
void asyncOp(@Suspended AsyncResponse response, @QueryParam("action") String action) {
|
||||||
CompletableFuture.runAsync({
|
CompletableFuture.runAsync({
|
||||||
// await for the test method to verify that there are no spans yet
|
// await for the test method to verify that there are no spans yet
|
||||||
BARRIER.await(1, SECONDS)
|
BARRIER.await(10, SECONDS)
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case "succeed":
|
case "succeed":
|
||||||
|
@ -143,7 +143,7 @@ class JaxRsTestResource {
|
||||||
def result = new CompletableFuture<String>()
|
def result = new CompletableFuture<String>()
|
||||||
CompletableFuture.runAsync({
|
CompletableFuture.runAsync({
|
||||||
// await for the test method to verify that there are no spans yet
|
// await for the test method to verify that there are no spans yet
|
||||||
BARRIER.await(1, SECONDS)
|
BARRIER.await(10, SECONDS)
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case "succeed":
|
case "succeed":
|
||||||
|
|
|
@ -129,7 +129,7 @@ abstract class AbstractJaxRsHttpServerTest<S> extends HttpServerTest<S> implemen
|
||||||
}
|
}
|
||||||
|
|
||||||
when: "barrier is released and resource class sends response"
|
when: "barrier is released and resource class sends response"
|
||||||
awaitBarrier(1, SECONDS)
|
awaitBarrier(10, SECONDS)
|
||||||
def response = futureResponse.join()
|
def response = futureResponse.join()
|
||||||
|
|
||||||
then:
|
then:
|
||||||
|
@ -172,7 +172,7 @@ abstract class AbstractJaxRsHttpServerTest<S> extends HttpServerTest<S> implemen
|
||||||
}
|
}
|
||||||
|
|
||||||
when: "barrier is released and resource class sends response"
|
when: "barrier is released and resource class sends response"
|
||||||
awaitBarrier(1, SECONDS)
|
awaitBarrier(10, SECONDS)
|
||||||
def response = futureResponse.join()
|
def response = futureResponse.join()
|
||||||
|
|
||||||
then:
|
then:
|
||||||
|
|
Loading…
Reference in New Issue