use of io.servicetalk.concurrent.api.Completable in project servicetalk by apple.
the class RetryingHttpRequesterFilterAutoRetryStrategiesTest method disableWaitForLb.
@ParameterizedTest
@ValueSource(booleans = { false, true })
void disableWaitForLb(boolean offloading) {
final ContextAwareRetryingHttpClientFilter filter = newFilter(new RetryingHttpRequesterFilter.Builder().waitForLoadBalancer(false), offloading);
Completable retry = applyRetry(filter, 1, NO_AVAILABLE_HOST);
toSource(retry).subscribe(retrySubscriber);
verifyRetryResultCompleted();
}
use of io.servicetalk.concurrent.api.Completable in project servicetalk by apple.
the class RetryingHttpRequesterFilterAutoRetryStrategiesTest method defaultForNoAvailableHostWhenServiceDiscovererTerminated.
@ParameterizedTest
@ValueSource(booleans = { false, true })
void defaultForNoAvailableHostWhenServiceDiscovererTerminated(boolean offloading) {
final ContextAwareRetryingHttpClientFilter filter = newFilter(new RetryingHttpRequesterFilter.Builder(), offloading);
Completable retry = applyRetry(filter, 1, NO_AVAILABLE_HOST);
toSource(retry).subscribe(retrySubscriber);
assertThat(retrySubscriber.pollTerminal(10, MILLISECONDS), is(nullValue()));
sdStatus.onComplete();
verifyRetryResultCompleted();
}
use of io.servicetalk.concurrent.api.Completable in project servicetalk by apple.
the class RetryingHttpRequesterFilterAutoRetryStrategiesTest method maxRetriesAreHonored.
@ParameterizedTest
@ValueSource(booleans = { false, true })
void maxRetriesAreHonored(boolean offloading) {
final ContextAwareRetryingHttpClientFilter filter = newFilter(new RetryingHttpRequesterFilter.Builder().maxTotalRetries(1), offloading);
Completable retry = applyRetry(filter, 2, RETRYABLE_EXCEPTION);
toSource(retry).subscribe(retrySubscriber);
verifyRetryResultError(RETRYABLE_EXCEPTION);
}
use of io.servicetalk.concurrent.api.Completable in project servicetalk by apple.
the class RetryingHttpRequesterFilterAutoRetryStrategiesTest method defaultForNonRetryableEx.
@ParameterizedTest
@ValueSource(booleans = { false, true })
void defaultForNonRetryableEx(boolean offloading) {
final ContextAwareRetryingHttpClientFilter filter = newFilter(new RetryingHttpRequesterFilter.Builder(), offloading);
Completable retry = applyRetry(filter, 1, DELIBERATE_EXCEPTION);
toSource(retry).subscribe(retrySubscriber);
verifyRetryResultError(DELIBERATE_EXCEPTION);
}
use of io.servicetalk.concurrent.api.Completable in project servicetalk by apple.
the class RetryingHttpRequesterFilterAutoRetryStrategiesTest method ignoreSdErrorsForNoAvailableHost.
@ParameterizedTest
@ValueSource(booleans = { false, true })
void ignoreSdErrorsForNoAvailableHost(boolean offloading) {
final ContextAwareRetryingHttpClientFilter filter = newFilter(new RetryingHttpRequesterFilter.Builder().ignoreServiceDiscovererErrors(true), offloading);
Completable retry = applyRetry(filter, 1, NO_AVAILABLE_HOST);
toSource(retry).subscribe(retrySubscriber);
assertThat("Unexpected subscribe for SD errors.", sdStatus.isSubscribed(), is(false));
assertThat(retrySubscriber.pollTerminal(10, MILLISECONDS), is(nullValue()));
lbEvents.onNext(LOAD_BALANCER_READY_EVENT);
verifyRetryResultCompleted();
}
Aggregations