diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/IdeFrameFixture.java b/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/IdeFrameFixture.java index bd9de030c62e..72b2685b2838 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/IdeFrameFixture.java +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/IdeFrameFixture.java @@ -371,7 +371,7 @@ public class IdeFrameFixture extends ComponentFixture actionManager.tryToExecute(mainMenuAction, fakeMainMenuMouseEvent, null, ActionPlaces.MAIN_MENU, true)); + DumbService.getInstance(getProject()).smartInvokeLater(() -> actionManager.tryToExecute(mainMenuAction, fakeMainMenuMouseEvent, null, ActionPlaces.MAIN_MENU, true)); } /** diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestRule.kt b/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestRule.kt index 1a86ce7c4951..1460041876ce 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestRule.kt +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestRule.kt @@ -6,7 +6,6 @@ import com.intellij.ide.GeneralSettings import com.intellij.ide.impl.ProjectUtil import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.application.TransactionGuard -import com.intellij.openapi.project.DumbService import com.intellij.openapi.project.Project import com.intellij.openapi.project.ProjectManager import com.intellij.openapi.util.io.FileUtil @@ -176,9 +175,8 @@ class GuiTestRule : TestRule { private fun tearDownProject() { if (myProjectPath != null) { val ideFrameFixture = IdeFrameFixture.find(robot(), myProjectPath, null) - ideFrameFixture.waitForStartingIndexing() if (ideFrameFixture.target().isShowing) { - DumbService.getInstance(ideFrameFixture.project).repeatUntilPassesInSmartMode { ideFrameFixture.closeProject() } + ideFrameFixture.closeProject() } FileUtilRt.delete(myProjectPath!!) } @@ -186,9 +184,7 @@ class GuiTestRule : TestRule { try { val ideFrameFixture = IdeFrameFixture.find(robot(), null, null, 2) if (ideFrameFixture.target().isShowing) - DumbService.getInstance(ideFrameFixture.project).repeatUntilPassesInSmartMode { ideFrameFixture.closeProject() - } } catch (e: ComponentLookupException) { // do nothing because ideFixture is already closed