From b837540690c5770bf94df2c29ed25e4ba24daad4 Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Fri, 20 Jul 2018 17:02:59 +0300 Subject: [PATCH] lst: fix LineStatusTrackerManagerTest Ensure that we dispatch `FileStatusManager.fileStatusesChanged` events before putting AfterUpdateRunnable request. Otherwise, we might wait till the end of update, but accidentally trigger another one, and `releaseUnneededTrackers` would do nothing. Tests were blinking after 0ec7ee057a186ed5ab8868ddd40e62aaf3d2196f. --- .../com/intellij/openapi/vcs/impl/LineStatusTrackerManager.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/LineStatusTrackerManager.kt b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/LineStatusTrackerManager.kt index 268476e51a5f..4aef2728d808 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/LineStatusTrackerManager.kt +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/LineStatusTrackerManager.kt @@ -1025,6 +1025,10 @@ class LineStatusTrackerManager( @TestOnly fun waitUntilBaseContentsLoaded() { + if (ApplicationManager.getApplication().isDispatchThread) { + UIUtil.dispatchAllInvocationEvents() + } + val semaphore = Semaphore() semaphore.down()