Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The progress indicator of the LaunchConfigurationsDialog is not shown when calling "run" with "fork == false" #769

Open
fedejeanne opened this issue Oct 25, 2023 · 0 comments

Comments

@fedejeanne
Copy link
Contributor

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 fork parameter at the end to false

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:

![image](https://github.com/eclipse-platform/eclipse.platform/assets/2205684/d675829d-e2f7-49c2-82e2-8e17c4e235b5)

* Set the `fork` parameter back to `true`
* Test again
   --> The progress indicator should be visible, like this:
![image](https://github.com/eclipse-platform/eclipse.platform/assets/2205684/ed858671-de98-4919-861e-48783e6b6cc6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant