Search in sources :

Example 1 with EndpointGroupException

use of com.linecorp.armeria.client.endpoint.EndpointGroupException in project zipkin by openzipkin.

the class ElasticsearchStorageTest method isOverCapacity.

/**
 * See {@link HttpCallTest#unprocessedRequest()} which shows {@link UnprocessedRequestException}
 * are re-wrapped as {@link RejectedExecutionException}.
 */
@Test
void isOverCapacity() {
    // timeout
    assertThat(storage.isOverCapacity(ResponseTimeoutException.get())).isTrue();
    // top-level
    assertThat(storage.isOverCapacity(new RejectedExecutionException("{\"status\":429,\"error\":{\"type\":\"es_rejected_execution_exception\"}}"))).isTrue();
    // re-wrapped
    assertThat(storage.isOverCapacity(new RejectedExecutionException("Rejected execution: No endpoints.", new EndpointGroupException("No endpoints")))).isTrue();
    // not applicable
    assertThat(storage.isOverCapacity(new IllegalStateException("Rejected execution"))).isFalse();
}
Also used : EndpointGroupException(com.linecorp.armeria.client.endpoint.EndpointGroupException) RejectedExecutionException(java.util.concurrent.RejectedExecutionException) Test(org.junit.jupiter.api.Test)

Aggregations

EndpointGroupException (com.linecorp.armeria.client.endpoint.EndpointGroupException)1 RejectedExecutionException (java.util.concurrent.RejectedExecutionException)1 Test (org.junit.jupiter.api.Test)1