mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-14 19:55:45 +02:00
Limit the max wait time for joining background jobs
This commit is contained in:
parent
312ea7796b
commit
f4f9b8af69
1 changed files with 5 additions and 3 deletions
|
@ -113,6 +113,8 @@ public class EditorTestHelper {
|
||||||
|
|
||||||
public static final String INTRO_VIEW_ID= "org.eclipse.ui.internal.introview";
|
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 {
|
public static IEditorPart openInEditor(IFile file, boolean runEventLoop) throws PartInitException {
|
||||||
IEditorPart part= IDE.openEditor(getActivePage(), file);
|
IEditorPart part= IDE.openEditor(getActivePage(), file);
|
||||||
if (runEventLoop)
|
if (runEventLoop)
|
||||||
|
@ -272,7 +274,7 @@ public class EditorTestHelper {
|
||||||
IIndexManager indexManager= CCorePlugin.getIndexManager();
|
IIndexManager indexManager= CCorePlugin.getIndexManager();
|
||||||
indexManager.joinIndexer(1000, new NullProgressMonitor());
|
indexManager.joinIndexer(1000, new NullProgressMonitor());
|
||||||
// Join jobs
|
// Join jobs
|
||||||
joinJobs(0, 0, 500);
|
joinJobs(0, 1000, 500);
|
||||||
Logger.global.exiting("EditorTestHelper", "joinBackgroundActivities");
|
Logger.global.exiting("EditorTestHelper", "joinBackgroundActivities");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -285,7 +287,7 @@ public class EditorTestHelper {
|
||||||
return allJobsQuiet();
|
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));
|
Logger.global.exiting("EditorTestHelper", "joinJobs", new Boolean(quiet));
|
||||||
return quiet;
|
return quiet;
|
||||||
}
|
}
|
||||||
|
@ -361,7 +363,7 @@ public class EditorTestHelper {
|
||||||
return !isRunning(cReconcilerAccessor, backgroundThreadAccessor);
|
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));
|
Logger.global.exiting("EditorTestHelper", "joinReconciler", new Boolean(finished));
|
||||||
return finished;
|
return finished;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue