1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-15 04:05:38 +02:00

Limit the max wait time for joining background jobs

This commit is contained in:
Anton Leherbauer 2007-02-13 16:12:03 +00:00
parent 312ea7796b
commit f4f9b8af69

View file

@ -113,6 +113,8 @@ public class EditorTestHelper {
public static final String INTRO_VIEW_ID= "org.eclipse.ui.internal.introview";
private static final long MAX_WAIT_TIME = 60000; // don't wait longer than 60 seconds
public static IEditorPart openInEditor(IFile file, boolean runEventLoop) throws PartInitException {
IEditorPart part= IDE.openEditor(getActivePage(), file);
if (runEventLoop)
@ -272,7 +274,7 @@ public class EditorTestHelper {
IIndexManager indexManager= CCorePlugin.getIndexManager();
indexManager.joinIndexer(1000, new NullProgressMonitor());
// Join jobs
joinJobs(0, 0, 500);
joinJobs(0, 1000, 500);
Logger.global.exiting("EditorTestHelper", "joinBackgroundActivities");
}
@ -285,7 +287,7 @@ public class EditorTestHelper {
return allJobsQuiet();
}
};
boolean quiet= helper.waitForCondition(getActiveDisplay(), maxTime > 0 ? maxTime : Long.MAX_VALUE, intervalTime);
boolean quiet= helper.waitForCondition(getActiveDisplay(), maxTime > 0 ? maxTime : MAX_WAIT_TIME, intervalTime);
Logger.global.exiting("EditorTestHelper", "joinJobs", new Boolean(quiet));
return quiet;
}
@ -361,7 +363,7 @@ public class EditorTestHelper {
return !isRunning(cReconcilerAccessor, backgroundThreadAccessor);
}
};
boolean finished= helper.waitForCondition(getActiveDisplay(), maxTime > 0 ? maxTime : Long.MAX_VALUE, intervalTime);
boolean finished= helper.waitForCondition(getActiveDisplay(), maxTime > 0 ? maxTime : MAX_WAIT_TIME, intervalTime);
Logger.global.exiting("EditorTestHelper", "joinReconciler", new Boolean(finished));
return finished;
}