Skip to content

Commit 7c53680

Browse files
committed
Avoid waiting for reconciler job
Not so nice workaround for eclipse-jdt#721. After eclipse-platform/eclipse.platform.ui#3025 every opened editor means there will be a reconciler job running, which is not what we do NOT want to wait for. AbstractReconciler.class is the family object we can check for, so add that family to the list of excluded jobs we don't care.
1 parent 5c25f09 commit 7c53680

File tree

1 file changed

+12
-1
lines changed
  • org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests

1 file changed

+12
-1
lines changed

org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/TestUtil.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
import org.eclipse.debug.core.DebugPlugin;
3232
import org.eclipse.debug.core.ILaunch;
3333
import org.eclipse.debug.core.ILaunchManager;
34+
import org.eclipse.debug.internal.ui.views.console.ProcessConsole;
3435
import org.eclipse.jdt.debug.testplugin.JavaTestPlugin;
36+
import org.eclipse.jface.text.reconciler.AbstractReconciler;
3537
import org.eclipse.swt.widgets.Display;
3638
import org.junit.Assert;
3739

@@ -120,7 +122,7 @@ public static void runEventLoop() {
120122
* @return true if the method timed out, false if all the jobs terminated before the timeout
121123
*/
122124
public static boolean waitForJobs(String owner, long minTimeMs, long maxTimeMs) {
123-
return waitForJobs(owner, minTimeMs, maxTimeMs, (Object[]) null);
125+
return waitForJobs(owner, minTimeMs, maxTimeMs, AbstractReconciler.class);
124126
}
125127

126128
/**
@@ -146,6 +148,15 @@ public static boolean waitForJobs(String owner, Object jobFamily, long minTimeMs
146148
if (maxTimeMs < minTimeMs) {
147149
throw new IllegalArgumentException("Max time is smaller as min time!");
148150
}
151+
// Not so nice workaround for https://github.com/eclipse-jdt/eclipse.jdt.debug/issues/721
152+
// After https://github.com/eclipse-platform/eclipse.platform.ui/pull/3025 every opened editor
153+
// means there will be a reconciler job running, which is not what we do NOT want to wait for.
154+
// AbstractReconciler.class is the family object we can check for.
155+
if (excludedFamilies == null) {
156+
excludedFamilies = new Object[] { AbstractReconciler.class };
157+
} else if (excludedFamilies.length == 1 && excludedFamilies[0] == ProcessConsole.class) {
158+
excludedFamilies = new Object[] { ProcessConsole.class, AbstractReconciler.class };
159+
}
149160
wakeUpSleepingJobs(jobFamily);
150161
final long startNanos = System.nanoTime();
151162
while (System.nanoTime() - startNanos < minTimeMs * 1_000_000L) {

0 commit comments

Comments
 (0)