Skip to content

Commit a15127b

Browse files
committed
Disable DetectVMInstallationsJob for JUnit Plug-in Test launches
This change disables the job org.eclipse.jdt.internal.launching.DetectVMInstallationsJob, via the respective system property, for JUnit Plug-in Test launches. This is done to reduce differences between the CI environment and launching from Eclipse, simplifying debugging of tests failing in the CI environment. Fixes: #2215
1 parent 518aa04 commit a15127b

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/JUnitWorkbenchLaunchShortcut.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
*/
4747
public class JUnitWorkbenchLaunchShortcut extends JUnitLaunchShortcut {
4848

49+
private static final String DETECT_VM_INSTALLATIONS_DISABLED = "-DDetectVMInstallationsJob.disabled"; //$NON-NLS-1$
50+
4951
@Override
5052
protected String getLaunchConfigurationTypeId() {
5153
return "org.eclipse.pde.ui.JunitLaunchConfig"; //$NON-NLS-1$
@@ -112,9 +114,13 @@ protected ILaunchConfigurationWorkingCopy createLaunchConfiguration(IJavaElement
112114

113115
// VM arguments
114116
String vmArgs = LaunchArgumentsHelper.getInitialVMArguments();
115-
if (vmArgs.length() > 0) {
116-
configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, vmArgs);
117+
if (!vmArgs.contains(DETECT_VM_INSTALLATIONS_DISABLED)) {
118+
if (!vmArgs.isEmpty()) {
119+
vmArgs += " "; //$NON-NLS-1$
120+
}
121+
vmArgs += DETECT_VM_INSTALLATIONS_DISABLED + "=true"; //$NON-NLS-1$
117122
}
123+
configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, vmArgs);
118124
configuration.setAttribute(IPDELauncherConstants.BOOTSTRAP_ENTRIES, ""); //$NON-NLS-1$
119125

120126
// configuration attributes

0 commit comments

Comments
 (0)