Skip to content

Commit c6fffdd

Browse files
committed
Wait on quick diff initialize before editing CU in test
Tracings of recent SaveParticipantTest fail show the quick diff initialize job, accessing GapTextStore in parallel to the tests. This change joins this initialize job, prior to editing CUs from the tests - to avoid potential race conditions. See: #79
1 parent 11c5a25 commit c6fffdd

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/SaveParticipantTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535

3636
import org.eclipse.jface.text.CopyOnWriteTextStore;
3737

38+
import org.eclipse.ui.internal.texteditor.quickdiff.DocumentLineDiffer;
39+
3840
import org.eclipse.jdt.core.IClasspathEntry;
3941
import org.eclipse.jdt.core.ICompilationUnit;
4042
import org.eclipse.jdt.core.IJavaProject;
@@ -105,6 +107,7 @@ public void tearDown() throws Exception {
105107
private static void editCUInEditor(ICompilationUnit cu, String newContent) throws Exception {
106108
JavaEditor editor= (JavaEditor) EditorUtility.openInEditor(cu);
107109
Job.getJobManager().join(ReconcilerJobFamilies.FAMILY_RECONCILER, null);
110+
Job.getJobManager().join(DocumentLineDiffer.QUICKDIFF_INITIALIZE_FAMILY, null);
108111
TestUtils.cancelDecorationJob();
109112

110113
cu.getBuffer().setContents(newContent);

0 commit comments

Comments
 (0)