void () { IntentionAction longLongUpdate = new AbstractIntentionAction() { @Override public void invoke(@NotNull Project project, Editor editor, PsiFile file) { } @Nls @NotNull @Override public String getText() { return "LongAction"; } @Override public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) { ApplicationManager.getApplication().assertIsNonDispatchThread(); return true; } }; IntentionManager.getInstance().addAction(longLongUpdate); Disposer.register(getTestRootDisposable(), () -> IntentionManager.getInstance().unregisterIntention(longLongUpdate)); configureByText(JavaFileType.INSTANCE, "class X { <caret> }"); makeEditorWindowVisible(new Point(0, 0), myEditor); doHighlighting(); myDaemonCodeAnalyzer.restart(); runWithReparseDelay(0, () -> { for (int i = 0; i < 1000; i++) { caretRight(); UIUtil.dispatchAllInvocationEvents(); caretLeft(); Object updateProgress = new HashMap<>(myDaemonCodeAnalyzer.getUpdateProgress()); long waitForDaemonStart = System.currentTimeMillis(); while (myDaemonCodeAnalyzer.getUpdateProgress().equals(updateProgress) && System.currentTimeMillis() < waitForDaemonStart + 5000) { // wait until the daemon started UIUtil.dispatchAllInvocationEvents(); } if (myDaemonCodeAnalyzer.getUpdateProgress().equals(updateProgress)) { throw new RuntimeException("Daemon failed to start in 5000 ms"); } long start = System.currentTimeMillis(); while (myDaemonCodeAnalyzer.isRunning() && System.currentTimeMillis() < start + 500) { UIUtil.dispatchAllInvocationEvents(); // wait for a bit more until ShowIntentionsPass.doApplyInformationToEditor() called } } }); }