Adapt to changes in the locking model for closing an app context

See gh-38666
This commit is contained in:
Andy Wilkinson 2023-12-12 14:50:20 +00:00
parent a242bd81e2
commit 612bf95b05
1 changed files with 2 additions and 2 deletions

View File

@ -112,8 +112,8 @@ class SpringApplicationShutdownHookTests {
closing.await();
Thread shutdownThread = new Thread(shutdownHook);
shutdownThread.start();
// Shutdown thread should become blocked on monitor held by context thread
Awaitility.await().atMost(Duration.ofSeconds(30)).until(shutdownThread::getState, State.BLOCKED::equals);
// Shutdown thread should start waiting for context to become inactive
Awaitility.await().atMost(Duration.ofSeconds(30)).until(shutdownThread::getState, State.TIMED_WAITING::equals);
// Allow context thread to proceed, unblocking shutdown thread
proceedWithClose.countDown();
contextThread.join();