eclipse.platform
eclipse.platform copied to clipboard
The progress indicator of the LaunchConfigurationsDialog is not shown when calling "run" with "fork == false"
If I call org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.run(boolean, boolean, IRunnableWithProgress) and pass false as the first parameter (fork) then the progress indicator never shows up in the bottom area of the dialog.
This was discovered while working on PR #674 (eclipse-pde)
How to reproduce
A small hack to help reproduce the error
Change the method org.eclipse.jdt.internal.junit.util.TestSearchEngine.findTestMethods(IRunnableContext, IJavaProject, IType, TestKind):
- Add some idle wait
- Set the
forkparameter at the end tofalse
In the end. it should look like this:
public static Set<String> findTestMethods(IRunnableContext context, final IJavaProject javaProject, IType type, TestKind testKind) throws InvocationTargetException, InterruptedException {
final Set<String> result= new HashSet<>();
IRunnableWithProgress runnable= progressMonitor -> {
try {
String message= Messages.format(JUnitMessages.TestSearchEngine_search_message_progress_monitor, type.getElementName());
SubMonitor subMonitor= SubMonitor.convert(progressMonitor, message, 1 + 5);// add + 5
// -----------------------------------------------
// Add this idle wait
// -----------------------------------------------
for (int i= 0; i < 5; i++) {
subMonitor.split(1);
Thread.sleep(1000);
}
// -----------------------------------------------
collectMethodNames(type, javaProject, testKind.getId(), result, subMonitor.split(1));
} catch (CoreException e) {
throw new InvocationTargetException(e);
}
};
// -----------------------------------------------
context.run(/*fork*/ false, true, runnable); // set "fork" to false --> no progress indicator at the bottom of the dialog
// -----------------------------------------------
return result;
}
## Test it
* Open the _Run Configurations Dialog_
* Create 2 valid JUnit configurations
* Switch between the configurations
--> This indicator at the bottom should **NOT** appear, it should look like this:

* Set the `fork` parameter back to `true`
* Test again
--> The progress indicator should be visible, like this:
