Skip to content

Commit 612bf95

Browse files
committed
Adapt to changes in the locking model for closing an app context
See gh-38666
1 parent a242bd8 commit 612bf95

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationShutdownHookTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ void runWhenContextIsBeingClosedInAnotherThreadWaitsUntilContextIsInactive() thr
112112
closing.await();
113113
Thread shutdownThread = new Thread(shutdownHook);
114114
shutdownThread.start();
115-
// Shutdown thread should become blocked on monitor held by context thread
116-
Awaitility.await().atMost(Duration.ofSeconds(30)).until(shutdownThread::getState, State.BLOCKED::equals);
115+
// Shutdown thread should start waiting for context to become inactive
116+
Awaitility.await().atMost(Duration.ofSeconds(30)).until(shutdownThread::getState, State.TIMED_WAITING::equals);
117117
// Allow context thread to proceed, unblocking shutdown thread
118118
proceedWithClose.countDown();
119119
contextThread.join();

0 commit comments

Comments
 (0)