From 37d395bad2cab560ca7e572bc28a56aa45d986b2 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Fri, 11 Jun 2021 19:48:34 +0100 Subject: [PATCH] Try to stabilize flaky MetricsWebClientFilterFunction test Closes gh-26855 --- .../client/MetricsWebClientFilterFunctionTests.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/reactive/client/MetricsWebClientFilterFunctionTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/reactive/client/MetricsWebClientFilterFunctionTests.java index 4e10dfbaf4..8bdcdf45cc 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/reactive/client/MetricsWebClientFilterFunctionTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/reactive/client/MetricsWebClientFilterFunctionTests.java @@ -146,17 +146,17 @@ class MetricsWebClientFilterFunctionTests { } @Test - void filterWhenExceptionAndRetryShouldNotCumulateRecordTime() { + void filterWhenExceptionAndRetryShouldNotAccumulateRecordTime() { ClientRequest request = ClientRequest .create(HttpMethod.GET, URI.create("https://example.com/projects/spring-boot")).build(); ExchangeFunction exchange = (r) -> Mono.error(new IllegalArgumentException()) - .delaySubscription(Duration.ofMillis(300)).cast(ClientResponse.class); + .delaySubscription(Duration.ofMillis(1000)).cast(ClientResponse.class); this.filterFunction.filter(request, exchange).retry(1) .onErrorResume(IllegalArgumentException.class, (t) -> Mono.empty()).block(Duration.ofSeconds(5)); Timer timer = this.registry.get("http.client.requests") .tags("method", "GET", "uri", "/projects/spring-boot", "status", "CLIENT_ERROR").timer(); assertThat(timer.count()).isEqualTo(2); - assertThat(timer.max(TimeUnit.MILLISECONDS)).isLessThan(600); + assertThat(timer.max(TimeUnit.MILLISECONDS)).isLessThan(2000); } }