use of reactor.util.retry.RetryBackoffSpec in project reactor-core by reactor.
the class FluxRetryWhenTest method fluxRetryRandomBackoffNoArithmeticException.
@Test
public void fluxRetryRandomBackoffNoArithmeticException() {
final Duration EXPLICIT_MAX = Duration.ofSeconds(100_000);
final Duration INIT = Duration.ofSeconds(10);
StepVerifier.withVirtualTime(() -> {
RetryBackoffSpec retryBuilder = Retry.backoff(80, INIT).maxBackoff(EXPLICIT_MAX).jitter(0d);
return Flux.error(new IllegalStateException("boom")).retryWhen(retryBuilder);
}).expectSubscription().thenAwait(Duration.ofNanos(Long.MAX_VALUE)).expectErrorSatisfies(e -> assertThat(e).hasMessage("Retries exhausted: 80/80").isInstanceOf(IllegalStateException.class).hasCause(new IllegalStateException("boom"))).verify();
}
Aggregations