From 1b6431c219afc2f14fdebc5d7425a4bc4af77a5a Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Sun, 29 Oct 2023 19:34:39 +0900 Subject: [PATCH] Fix shouldStopKeepAliveThreadIfContextIsClosed() See gh-38103 --- .../org/springframework/boot/SpringApplicationTests.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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(