From 02ef2e25b3af5c005382a58e3f441070953175fe Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Thu, 28 Nov 2024 13:39:27 +0000 Subject: [PATCH] Try to make test less likely to fail --- .../server/health/ActuatorHealthAdapterInvokerTests.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-grpc-spring-boot-autoconfigure/src/test/java/org/springframework/grpc/autoconfigure/server/health/ActuatorHealthAdapterInvokerTests.java b/spring-grpc-spring-boot-autoconfigure/src/test/java/org/springframework/grpc/autoconfigure/server/health/ActuatorHealthAdapterInvokerTests.java index 1c1dfc1..4ecedf7 100644 --- a/spring-grpc-spring-boot-autoconfigure/src/test/java/org/springframework/grpc/autoconfigure/server/health/ActuatorHealthAdapterInvokerTests.java +++ b/spring-grpc-spring-boot-autoconfigure/src/test/java/org/springframework/grpc/autoconfigure/server/health/ActuatorHealthAdapterInvokerTests.java @@ -15,8 +15,8 @@ */ package org.springframework.grpc.autoconfigure.server.health; +import static org.mockito.Mockito.atLeast; import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import java.time.Duration; @@ -39,8 +39,8 @@ void healthAdapterInvokedOnSchedule() { try { invoker.afterPropertiesSet(); Awaitility.await() - .between(Duration.ofSeconds(8), Duration.ofSeconds(10)) - .untilAsserted(() -> verify(healthAdapter, times(2)).updateHealthStatus()); + .between(Duration.ofSeconds(6), Duration.ofSeconds(12)) + .untilAsserted(() -> verify(healthAdapter, atLeast(2)).updateHealthStatus()); } finally { invoker.destroy();