diff --git a/org.eclipse.xtext.ui.tests/src-longrunning/org/eclipse/xtext/ui/tests/editor/DirtyStateEditorSupportIntegrationTest.java b/org.eclipse.xtext.ui.tests/src-longrunning/org/eclipse/xtext/ui/tests/editor/DirtyStateEditorSupportIntegrationTest.java index c6984cb1f1c..27c2c5c8e98 100644 --- a/org.eclipse.xtext.ui.tests/src-longrunning/org/eclipse/xtext/ui/tests/editor/DirtyStateEditorSupportIntegrationTest.java +++ b/org.eclipse.xtext.ui.tests/src-longrunning/org/eclipse/xtext/ui/tests/editor/DirtyStateEditorSupportIntegrationTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.jobs.Job; @@ -144,16 +145,13 @@ public void testUndoRedo() throws Exception { try (FileWriter fw = new FileWriter(externalEditFile)) { fw.write(""); } - - assertFalse(fileDocumentProvider.isSynchronized(editor.getEditorInput())); + ((IFileEditorInput)editor.getEditorInput()).getFile().refreshLocal(IResource.DEPTH_ONE, new NullProgressMonitor()); + Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_REFRESH, null); + assertTrue(fileDocumentProvider.isSynchronized(editor.getEditorInput())); editor.setFocus(); Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_REFRESH, null); syncUtil.yieldToQueuedDisplayJobs(new NullProgressMonitor()); - syncUtil.waitForReconciler(editor); - syncUtil.waitForBuild(new NullProgressMonitor()); - - assertTrue(fileDocumentProvider.isSynchronized(editor.getEditorInput())); assertEquals(document.get(), ""); }