diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java index 92eefe0e3f..877433d23b 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java @@ -1425,8 +1425,9 @@ class SpringApplicationTests { this.context.close(); Awaitility.await() .atMost(Duration.ofSeconds(30)) - .untilAsserted(() -> assertThat(getCurrentThreads()) - .filteredOn((thread) -> thread.getName().equals("keep-alive"))); + .untilAsserted( + () -> assertThat(getCurrentThreads()).filteredOn((thread) -> thread.getName().equals("keep-alive")) + .isEmpty()); } private ArgumentMatcher isAvailabilityChangeEventWithState(