fix blinking EditorHistoryManagerTest.testSavingStateForNotOpenedEditors test

This commit is contained in:
Dmitry Batrak
2018-11-09 19:05:52 +03:00
parent 121cdf2da3
commit d705ea92ca

View File

@@ -479,6 +479,8 @@ public class EditorTestUtil {
public static void waitForLoading(Editor editor) {
ApplicationManager.getApplication().assertIsDispatchThread();
if (editor == null) return;
UIUtil.dispatchAllInvocationEvents(); // if editor is loaded synchronously,
// background loading thread stays blocked in 'invokeAndWait' call
while (!AsyncEditorLoader.isEditorLoaded(editor)) {
LockSupport.parkNanos(100_000_000);
UIUtil.dispatchAllInvocationEvents();