From a15127b0de6150f6504dff6c26f66934cabc44c6 Mon Sep 17 00:00:00 2001 From: Simeon Andreev Date: Wed, 18 Feb 2026 18:59:29 +0200 Subject: [PATCH] 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 --- .../pde/ui/launcher/JUnitWorkbenchLaunchShortcut.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/JUnitWorkbenchLaunchShortcut.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/JUnitWorkbenchLaunchShortcut.java index 3dfff5d991b..072693646cf 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/JUnitWorkbenchLaunchShortcut.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/JUnitWorkbenchLaunchShortcut.java @@ -46,6 +46,8 @@ */ public class JUnitWorkbenchLaunchShortcut extends JUnitLaunchShortcut { + private static final String DETECT_VM_INSTALLATIONS_DISABLED = "-DDetectVMInstallationsJob.disabled"; //$NON-NLS-1$ + @Override protected String getLaunchConfigurationTypeId() { return "org.eclipse.pde.ui.JunitLaunchConfig"; //$NON-NLS-1$ @@ -112,9 +114,13 @@ protected ILaunchConfigurationWorkingCopy createLaunchConfiguration(IJavaElement // VM arguments String vmArgs = LaunchArgumentsHelper.getInitialVMArguments(); - if (vmArgs.length() > 0) { - configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, vmArgs); + if (!vmArgs.contains(DETECT_VM_INSTALLATIONS_DISABLED)) { + if (!vmArgs.isEmpty()) { + vmArgs += " "; //$NON-NLS-1$ + } + vmArgs += DETECT_VM_INSTALLATIONS_DISABLED + "=true"; //$NON-NLS-1$ } + configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, vmArgs); configuration.setAttribute(IPDELauncherConstants.BOOTSTRAP_ENTRIES, ""); //$NON-NLS-1$ // configuration attributes