Skip to content

Conversation

@trancexpress
Copy link
Contributor

@trancexpress trancexpress commented Nov 10, 2025

Launching org.eclipse.pde.junit.runtime.tests.JUnitRuntimeTests or
org.eclipse.pde.ui.tests.launcher.PluginBasedLaunchTest from Eclipse
results in the following exception:

org.eclipse.core.runtime.CoreException: Launching failed. Bootstrap code
cannot be found.

Adding org.eclipse.equinox.launcher to the required bundles of
org.eclipse.pde.junit.runtime.tests and org.eclipse.pde.ui.tests avoids
these errors.

Fixes: #2024

@trancexpress
Copy link
Contributor Author

@laeubi the tests run properly with this change.

@github-actions
Copy link

github-actions bot commented Nov 10, 2025

Test Results

   771 files  ±0     771 suites  ±0   51m 12s ⏱️ - 4m 38s
 3 648 tests ±0   3 594 ✅ +1   54 💤 ±0  0 ❌  - 1 
10 878 runs  ±0  10 715 ✅ +1  163 💤 ±0  0 ❌  - 1 

Results for commit 82a3f99. ± Comparison against base commit 1b810d7.

♻️ This comment has been updated with latest results.

@trancexpress trancexpress force-pushed the gh2024 branch 2 times, most recently from 2557916 to 805befa Compare November 10, 2025 15:45
@trancexpress
Copy link
Contributor Author

One failure is:

 Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 5.970 s <<< FAILURE! -- in JUnitRuntimeTests org.eclipse.pde.junit.runtime.tests.JUnit5SuiteExecutionTest
org.eclipse.pde.junit.runtime.tests.JUnit5SuiteExecutionTest.executePackage -- Time elapsed: 2.143 s <<< FAILURE!
java.lang.AssertionError: test completed with Error
	at org.eclipse.pde.junit.runtime.tests.JUnitExecutionTest.assertSuccessful(JUnitExecutionTest.java:141)
	at org.eclipse.pde.junit.runtime.tests.JUnit5SuiteExecutionTest.executePackage(JUnit5SuiteExecutionTest.java:68)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.eclipse.pde.ui.tests.runtime.TestUtils$1.evaluate(TestUtils.java:267)
	Suppressed: java.lang.AssertionError: FailureTrace of TestSuite: verification.tests.junit5.suite.TestSuite : Completed - Error (0):

org.junit.platform.suite.engine.NoTestsDiscoveredException: Suite [verification.tests.junit5.suite.TestSuite] did not discover any tests
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)


		at org.eclipse.pde.junit.runtime.tests.JUnitExecutionTest.addFailureTraces(JUnitExecutionTest.java:151)
		at org.eclipse.pde.junit.runtime.tests.JUnitExecutionTest.addFailureTraces(JUnitExecutionTest.java:156)
		at org.eclipse.pde.junit.runtime.tests.JUnitExecutionTest.assertSuccessful(JUnitExecutionTest.java:142)
		... 3 more

@trancexpress
Copy link
Contributor Author

The instability in the current run is:

org.eclipse.pde.genericeditor.extension.tests.UpdateUnitVersionsCommandTests.testVersionSort -- Time elapsed: 0.068 s <<< FAILURE!
org.junit.ComparisonFailure: 
ID: org.eclipse.fake.5 has the incorrect version. updatedText=<target>
<locations>
<location>
<unit id="org.eclipse.fake.1" version="0.0.0"/>
<unit id="org.eclipse.fake.2" version="0.0.0"/>
<unit id="org.eclipse.fake.3" version="0.0.0"/>
<unit id="org.eclipse.fake.4" version="0.0.0"/>
<unit id="org.eclipse.fake.5" version="0.0.0"/>
<unit id="org.eclipse.fake.6" version="0.0.0"/>
<unit id="org.eclipse.fake.7" version="0.0.0"/>
<repository location="bundleentry://369.fwk762883339/testing-files/testing-sites/MultipleUnitsConfirmSorting/"/>
</location>
</locations>
</target> expected:<[1.1.1.banana]> but was:<[0.0.0]>
	at org.junit.Assert.assertEquals(Assert.java:117)
	at org.eclipse.pde.genericeditor.extension.tests.UpdateUnitVersionsCommandTests.confirmVersionUpdates(UpdateUnitVersionsCommandTests.java:93)
	at org.eclipse.pde.genericeditor.extension.tests.UpdateUnitVersionsCommandTests.testVersionSort(UpdateUnitVersionsCommandTests.java:55)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.junit.runners.Suite.runChild(Suite.java:128)
	at org.junit.runners.Suite.runChild(Suite.java:27)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.junit.runners.Suite.runChild(Suite.java:128)
	at org.junit.runners.Suite.runChild(Suite.java:27)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.apache.maven.surefire.junitcore.JUnitCore.run(JUnitCore.java:49)
	at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.createRequestAndRun(JUnitCoreWrapper.java:120)
	at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.executeEager(JUnitCoreWrapper.java:95)
	at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:75)
	at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:69)
	at org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:146)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.apache.maven.surefire.api.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:137)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:148)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:88)
	at org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.invokeSureFire(OsgiSurefireBooter.java:195)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:116)
	at org.eclipse.tycho.surefire.osgibooter.AbstractUITestApplication$1.run(AbstractUITestApplication.java:42)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Testable.lambda$1(E4Testable.java:127)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:132)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4382)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4005)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1147)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1038)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:677)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:583)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:185)
	at org.eclipse.tycho.surefire.osgibooter.UITestApplication.runApplication(UITestApplication.java:34)
	at org.eclipse.tycho.surefire.osgibooter.AbstractUITestApplication.run(AbstractUITestApplication.java:129)
	at org.eclipse.tycho.surefire.osgibooter.UITestApplication.start(UITestApplication.java:44)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:219)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:149)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:115)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:467)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:298)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:615)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:563)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1415)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1387)

@laeubi
Copy link
Contributor

laeubi commented Nov 11, 2025

@laeubi the tests run properly with this change.

What I'm wondering is, why is it needed now and was not needed before?

@trancexpress
Copy link
Contributor Author

What I'm wondering is, why is it needed now and was not needed before?

Any specific version you want me to check with? I tried with 4.14 (when the test was first added) but there is some nonsense message there.

@laeubi
Copy link
Contributor

laeubi commented Nov 11, 2025

Any specific version you want me to check with? I tried with 4.14 (when the test was first added) but there is some nonsense message there.

Jenkins work, Github works, I-Build works ... or do I miss something here? So if it is only an issue in the IDE we need to check why its different there as it seems not needed elsewhere (and I haven seen it recently when looking into this tests as well).

@trancexpress
Copy link
Contributor Author

A recent change in one if the tests that fail is: bf28bcf

org.eclipse.pde.ui.tests.launcher.PluginBasedLaunchTest.testTwoVersionsOfSameBundleConfigIni()

@HannesWell can you remember if executing this test from Eclipse worked? I assume it did.

That would reduce the potential degradation interval to 04.2023 until now.

@trancexpress
Copy link
Contributor Author

trancexpress commented Nov 11, 2025

With Eclipse 4.36 and R4_36 JUnitRuntimeTests runs fine in Eclipse.

Eclipse SDK
Version: 2025-06 (4.36)
Build id: I20250528-1830

At Eclipse 4.37 and R4_37 JUnitRuntimeTests fails with the exception:

Eclipse SDK
Version: 2025-09 (4.37)
Build id: I20250905-0730
org.eclipse.core.runtime.CoreException: Required plug-in 'org.eclipse.jdt.junit5.runtime' could not be found.
	at org.eclipse.pde.launching.JUnitLaunchConfigurationDelegate.abort(JUnitLaunchConfigurationDelegate.java:184)
	at org.eclipse.pde.launching.JUnitLaunchConfigurationDelegate.findRequiredPluginInTargetOrHost(JUnitLaunchConfigurationDelegate.java:403)
	at org.eclipse.pde.launching.JUnitLaunchConfigurationDelegate.addAbsentRequirements(JUnitLaunchConfigurationDelegate.java:581)
	at org.eclipse.pde.launching.JUnitLaunchConfigurationDelegate.addRequiredJunitRuntimePlugins(JUnitLaunchConfigurationDelegate.java:570)
	at org.eclipse.pde.launching.JUnitLaunchConfigurationDelegate.preLaunchCheck(JUnitLaunchConfigurationDelegate.java:540)
	at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.getVMRunnerConfiguration(JUnitLaunchConfigurationDelegate.java:138)

Some tests fail with:

org.eclipse.core.runtime.CoreException: Launching failed. Bootstrap code cannot be found.
	at org.eclipse.pde.launching.JUnitLaunchConfigurationDelegate.abort(JUnitLaunchConfigurationDelegate.java:180)
	at org.eclipse.pde.launching.JUnitLaunchConfigurationDelegate.getClasspathAndModulepath(JUnitLaunchConfigurationDelegate.java:458)
	at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.getVMRunnerConfiguration(JUnitLaunchConfigurationDelegate.java:192)
	at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.launch(JUnitLaunchConfigurationDelegate.java:275)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:778)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:689)
	at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1052)
	at org.eclipse.debug.ui.DebugUITools.buildAndLaunch(DebugUITools.java:1027)
	at org.eclipse.pde.junit.runtime.tests.TestExecutionUtil.launchAndWaitForTermination(TestExecutionUtil.java:126)
	at org.eclipse.pde.junit.runtime.tests.TestExecutionUtil.runTest(TestExecutionUtil.java:81)
	at org.eclipse.pde.junit.runtime.tests.JUnitExecutionTest.executeType(JUnitExecutionTest.java:102)

Its hard to bisect this though...

In the passing case, model is not null:

	private static String getEquinoxStartupPath(String packageName) throws CoreException {
		// See if PDE has the launcher in the workspace or target
		IPluginModelBase model = PluginRegistry.findModel(IPDEBuildConstants.BUNDLE_EQUINOX_LAUNCHER);

Last build I have without the bug:

Eclipse SDK
Version: 2025-09 (4.37)
Build id: I20250704-0510

First build I have with the bug:

Eclipse SDK
Version: 2025-09 (4.37)
Build id: I20250711-0510

I wasn't able to bisect with just PDE, likely something else changed. Maybe something in Equinox...

@HannesWell
Copy link
Member

can you remember if executing this test from Eclipse worked? I assume it did.

I'm pretty sure it worked when I developed these tests. But I don't recall exactly when I executed them last from the IDE.
Have to check it tomorrow.

@trancexpress
Copy link
Contributor Author

Seems like org.eclipse.equinox.internal.simpleconfigurator.utils.SimpleConfiguratorUtils.readConfiguration(URL, URI) doesn't see the org.eclipse.equinox.launcher bundle:

➜  ~ cat /tmp/tst2/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.equinox.simpleconfigurator/bundles.info  | grep launcher
junit-platform-launcher,1.13.3,file:/data/eclipses/eclipse_437_20250713/plugins/junit-platform-launcher_1.13.3.jar,4,false
➜  ~ cat /tmp/tst1/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.equinox.simpleconfigurator/bundles.info | grep launcher
junit-platform-launcher,1.13.2,file:/data/eclipses/eclipse_437_20250703/plugins/junit-platform-launcher_1.13.2.jar,4,false
org.eclipse.equinox.launcher,1.7.0.v20250519-0528,file:/data/eclipses/eclipse_437_20250703/plugins/org.eclipse.equinox.launcher_1.7.0.v20250519-0528.jar,4,false
org.eclipse.equinox.launcher.gtk.linux.x86_64,1.2.1400.v20250331-1702,file:/data/eclipses/eclipse_437_20250703/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.2.1400.v20250331-1702/,4,false

From then on a lot of things are called, but essentially this code doesn't add the launcher bundle because its missing above:

	@BeforeClass
	public static void setupProjects() throws Exception {
		Pattern junitRuntimeIDs = Pattern
				.compile("\\.junit\\d*\\.runtime|junit\\..+\\.engine$|org\\.junit\\.platform\\.launcher");
		TargetPlatformUtil.setRunningPlatformSubSetAsTarget(TargetPlatformUtil.class + "_target", b -> {

In particular installedBundles in org.eclipse.pde.ui.tests.util.TargetPlatformUtil.addRunningPlatformBundles(Collection<ITargetLocation>, Predicate<Bundle>) doesn't contain the launcher bundle:

	private static List<NameVersionDescriptor> addRunningPlatformBundles(Collection<ITargetLocation> bundleContainers,
			Predicate<Bundle> bundleFilter) {
		Bundle[] installedBundles = FrameworkUtil.getBundle(TargetPlatformUtil.class).getBundleContext().getBundles();

Likely I cannot bisect this properly since its not a problem when tests are launched, its a problem when the launch is created...

@trancexpress
Copy link
Contributor Author

trancexpress commented Nov 11, 2025

Bisected this to: 1a5255b

Note that launching the test must be done from a debuggee Eclipse. The test configuration differs, not the test runtime itself. For the different configuration to be generated while bisecting, the intermediate Eclipse instance is necessary. Also existing launch configs have to be deleted before checking with each PDE state.

See screen recording:

vokoscreenNG-2025-11-12_00-26-19.mp4

@laeubi
Copy link
Contributor

laeubi commented Nov 12, 2025

The test configuration differs, not the test runtime itself.

I'm not completely sure what you mean by "differs" because before the change simply all bundles where always added (what of course include the launcher bundle somehow) but it does not explain why Tycho is able to compute the required sets and PDE not... maybe Tycho is including the launcher by default (possible) and PDE should do the same, but I think we first should understand why the launcher is required at all (what seems not obvious to me) and why it is not found by the automatic inclusion of requirements.

@trancexpress
Copy link
Contributor Author

I'm not completely sure what you mean by "differs" because before the change simply all

Yes, that is the difference, the launch configuration differs now. That leads to the runtime error later on, even if the code executed at runtime isn't different.

but I think we first should understand why the launcher is required at all (what seems not obvious to me)

That is fairly straightforward, in terms of code. For this exception to occur:

org.eclipse.core.runtime.CoreException: Launching failed. Bootstrap code cannot be found.
	at org.eclipse.pde.launching.JUnitLaunchConfigurationDelegate.abort(JUnitLaunchConfigurationDelegate.java:178)
	at org.eclipse.pde.launching.JUnitLaunchConfigurationDelegate.getClasspathAndModulepath(JUnitLaunchConfigurationDelegate.java:444)
	at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.getVMRunnerConfiguration(JUnitLaunchConfigurationDelegate.java:192)
	at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.launch(JUnitLaunchConfigurationDelegate.java:275)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:778)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:689)
	at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1052)
	at org.eclipse.debug.ui.DebugUITools.buildAndLaunch(DebugUITools.java:1044)
	at org.eclipse.pde.junit.runtime.tests.TestExecutionUtil.launchAndWaitForTermination(TestExecutionUtil.java:126)
	at org.eclipse.pde.junit.runtime.tests.TestExecutionUtil.runTest(TestExecutionUtil.java:81)
	at org.eclipse.pde.junit.runtime.tests.JUnitExecutionTest.executePackage(JUnitExecutionTest.java:111)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.eclipse.pde.ui.tests.runtime.TestUtils$1.evaluate(TestUtils.java:267)

The following code is called: org.eclipse.pde.launching.JUnitLaunchConfigurationDelegate.getClasspathAndModulepath(ILaunchConfiguration)

	@Override
	public String[][] getClasspathAndModulepath(ILaunchConfiguration configuration) throws CoreException {
		String[] classpath = LaunchArgumentsHelper.constructClasspath(configuration);
		if (classpath == null) {
			abort(PDEMessages.WorkbenchLauncherConfigurationDelegate_noStartup, null, IStatus.OK); // <---- this is the line that reports the error
		}
		String[][] cpmp = super.getClasspathAndModulepath(configuration);
		cpmp[0] = classpath;
		return cpmp;
	}

org.eclipse.pde.internal.launching.launcher.LaunchArgumentsHelper.constructClasspath(ILaunchConfiguration) then has this code:

	public static String[] constructClasspath(ILaunchConfiguration configuration) throws CoreException {
		double targetVersion = TargetPlatformHelper.getTargetVersion();
		String jarPath = targetVersion >= 3.3 ? getEquinoxStartupPath(IPDEBuildConstants.BUNDLE_EQUINOX_LAUNCHER) : getStartupJarPath();
		if (jarPath == null && targetVersion < 3.3) {
			jarPath = getEquinoxStartupPath("org.eclipse.core.launcher"); //$NON-NLS-1$
		}
		if (jarPath == null) {
			return null; // <---- the method exits here
		}
		String bootstrap = configuration.getAttribute(IPDELauncherConstants.BOOTSTRAP_ENTRIES, ""); //$NON-NLS-1$
		Stream<String> bootstrapElements = splitElementsByComma(getSubstitutedString(bootstrap));
		return Stream.concat(Stream.of(jarPath), bootstrapElements).toArray(String[]::new);
	}

org.eclipse.pde.internal.launching.launcher.LaunchArgumentsHelper.getEquinoxStartupPath(String) does two things:

		// See if PDE has the launcher in the workspace or target
		IPluginModelBase model = PluginRegistry.findModel(IPDEBuildConstants.BUNDLE_EQUINOX_LAUNCHER);
		// No PDE model, see if the launcher bundle is installed
		Bundle bundle = Platform.getBundle(IPDEBuildConstants.BUNDLE_EQUINOX_LAUNCHER);

If both return null, the method returns null.

and why it is not found by the automatic inclusion of requirements

I'll see if I have time for this today.

@laeubi
Copy link
Contributor

laeubi commented Nov 12, 2025

Alright it then seems that we really need the launcher here as it has to be either in the target or is expected to be present in the runtime. Adding it to the manifest then seems fine, but we should add an @Reference(some class from the launcher bundle) to document this requirement and make it not look unused here.

@trancexpress
Copy link
Contributor Author

and why it is not found by the automatic inclusion of requirements

Should be this code in org.eclipse.pde.internal.launching.launcher.BundleLauncherHelper.computeDependencies(Set<IPluginModelBase>, Set<Options>, boolean):

Set<BundleDescription> closure = DependencyManager.findRequirementsClosure(launchBundles, options.toArray(DependencyManager.Options[]::new));
"Worker-11: Launching JUnitExecutionTest" #207 [28040] prio=5 os_prio=0 cpu=8583.46ms elapsed=310.62s tid=0x00007f8efc04cfd0 nid=28040 runnable  [0x00007f8fb517f000]
   java.lang.Thread.State: RUNNABLE
        at org.eclipse.pde.internal.launching.launcher.BundleLauncherHelper.computeDependencies(BundleLauncherHelper.java:572)
        at org.eclipse.pde.internal.launching.launcher.BundleLauncherHelper.addRequiredBundles(BundleLauncherHelper.java:173)
        at org.eclipse.pde.internal.launching.launcher.BundleLauncherHelper.getMergedBundleMap(BundleLauncherHelper.java:151)
        at org.eclipse.pde.internal.launching.launcher.BundleLauncherHelper.getMergedBundleMap(BundleLauncherHelper.java:112)
        at org.eclipse.pde.launching.JUnitLaunchConfigurationDelegate.preLaunchCheck(JUnitLaunchConfigurationDelegate.java:517)
        at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.getVMRunnerConfiguration(JUnitLaunchConfigurationDelegate.java:139)
        at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.launch(JUnitLaunchConfigurationDelegate.java:286)
        - locked <0x0000000724a4cd18> (a org.eclipse.pde.launching.JUnitLaunchConfigurationDelegate)
        at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:778)
        at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:689)
        at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1052)
        at org.eclipse.debug.internal.ui.DebugUIPlugin$1.run(DebugUIPlugin.java:1254)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

equinox bundles added here are:

 org.eclipse.equinox.event_1.7.300.v20250518-0609
 org.eclipse.equinox.frameworkadmin_2.3.500.v20250716-0529]
 org.eclipse.equinox.frameworkadmin.equinox_1.3.400.v20250515-0513
 org.eclipse.equinox.http.jetty_3.9.600.v20251031-0358
 org.eclipse.equinox.http.service.api_1.2.102.v20250520-0629
 org.eclipse.equinox.http.servlet_1.8.600.v20251106-0649
 org.eclipse.equinox.p2.artifact.repository_1.5.800.v20250620-1926
 org.eclipse.equinox.p2.core_2.13.200.v20251016-1550
 org.eclipse.equinox.p2.director_2.6.800.v20250714-1236
 org.eclipse.equinox.p2.directorywatcher_1.4.800.v20250922-0444
 org.eclipse.equinox.p2.engine_2.10.600.v20250724-1029
 org.eclipse.equinox.p2.extensionlocation_1.5.700.v20250720-1526
 org.eclipse.equinox.p2.garbagecollector_1.3.700.v20250715-0459
 org.eclipse.equinox.p2.jarprocessor_1.3.600.v20250517-0338
 org.eclipse.equinox.p2.metadata_2.9.600.v20250925-1411
 org.eclipse.equinox.p2.metadata.repository_1.5.700.v20250720-0955
 org.eclipse.equinox.p2.operations_2.7.700.v20250720-1530
 org.eclipse.equinox.p2.publisher_1.9.600.v20250720-0951
 org.eclipse.equinox.p2.publisher.eclipse_1.6.600.v20250720-1525
 org.eclipse.equinox.p2.repository_2.9.500.v20250721-0421
 org.eclipse.equinox.p2.repository.tools_2.4.800.v20250720-1525
 org.eclipse.equinox.p2.touchpoint.eclipse_2.4.600.v20250722-0413
 org.eclipse.equinox.p2.ui_2.8.1000.v20251023-1423
 org.eclipse.equinox.p2.updatesite_1.3.800.v20250606-0550
 org.eclipse.equinox.preferences_3.12.0.v20250721-0426
 org.eclipse.equinox.registry_3.12.600.v20250906-0651
 org.eclipse.equinox.security_1.4.700.v20250622-1644
 org.eclipse.equinox.security.ui_1.4.600.v20250722-0503
 org.eclipse.equinox.simpleconfigurator_1.5.700.v20250921-0614
 org.eclipse.equinox.simpleconfigurator.manipulator_2.3.600.v20250729-0655

But no org.eclipse.equinox.launch bundle in closure.

includedPlugins has contents:

org.eclipse.pde.junit.runtime.tests
org.eclipse.ui.ide.application
org.eclipse.osgi

Considering that org.eclipse.pde.internal.launching.launcher.LaunchArgumentsHelper.constructClasspath(ILaunchConfiguration) requires org.eclipse.equinox.launcher and org.eclipse.pde.launching.JUnitLaunchConfigurationDelegate.getClasspathAndModulepath(ILaunchConfiguration) will fail if its missing, should the PDE JUnitLaunchConfigurationDelegate always require org.eclipse.equinox.launcher?

I.e. similar to how we add JUnit bundles in org.eclipse.pde.launching.JUnitLaunchConfigurationDelegate.preLaunchCheck(ILaunchConfiguration, ILaunch, IProgressMonitor), should we add also org.eclipse.equinox.launcher (if its not there already)?

It does seem odd to have to add to the MANIFEST.MF even though the test code itself doesn't need it.

Or is LaunchArgumentsHelper.constructClasspath supposed to work also without org.eclipse.equinox.launcher in the target?

@laeubi
Copy link
Contributor

laeubi commented Nov 12, 2025

It does seem odd to have to add to the MANIFEST.MF even though the test code itself doesn't need it.

You showed that the code actually need it or throws exception, this is similar as with classforname ... even if not explicitly required it is implicit.

should the PDE JUnitLaunchConfigurationDelegate always require org.eclipse.equinox.launcher

Maybe yes, I remember I added equinox there recently as well (what obviously do not work without it)

Or is LaunchArgumentsHelper.constructClasspath supposed to work also without org.eclipse.equinox.launcher in the target?

That's the interesting question .. one would hope it is not required at all.

@trancexpress
Copy link
Contributor Author

should the PDE JUnitLaunchConfigurationDelegate always require org.eclipse.equinox.launcher

Maybe yes, I remember I added equinox there recently as well (what obviously do not work without it)

@laeubi do you prefer this change then?

diff --git a/ui/org.eclipse.pde.launching/src/org/eclipse/pde/launching/JUnitLaunchConfigurationDelegate.java b/ui/org.eclipse.pde.launching/src/org/eclipse/pde/launching/JUnitLaunchConfigurationDelegate.java
index dfd2610cdf..97148fff2d 100644
--- a/ui/org.eclipse.pde.launching/src/org/eclipse/pde/launching/JUnitLaunchConfigurationDelegate.java
+++ b/ui/org.eclipse.pde.launching/src/org/eclipse/pde/launching/JUnitLaunchConfigurationDelegate.java
@@ -107,6 +107,7 @@ public class JUnitLaunchConfigurationDelegate extends org.eclipse.jdt.junit.laun
                                List<String> applicationRequirements = RequirementHelper.getApplicationRequirements(application);
                                List<String> list = new ArrayList<>(applicationRequirements);
                                list.add(IPDEBuildConstants.BUNDLE_OSGI);
+                               list.add(IPDEBuildConstants.BUNDLE_EQUINOX_LAUNCHER);
                                return list;
                        }
                        return List.of(IPDEBuildConstants.BUNDLE_OSGI);

From my POV, only a few PDE tests seem to test launching plug-in tests... And its those that require the launcher bundle. Aside from this bundle, there are two test methods in org.eclipse.pde.ui.tests, org.eclipse.pde.ui.tests.launcher.PluginBasedLaunchTest.testTwoVersionsOfSameBundleConfigIni() and org.eclipse.pde.ui.tests.launcher.PluginBasedLaunchTest.testTwoVersionsOfSameBundleBundlesInfo(), which also fail.

So we can add the launcher to also the dependencies of org.eclipse.pde.ui.tests and be done here. Or we can add it always to plug-in test launches... which is probably an overkill. We would need it only if the launched test launches plug-in tests itself...

@trancexpress trancexpress changed the title Added missing requirement to org.eclipse.equinox.launcher in test bundle Added missing requirement to org.eclipse.equinox.launcher in test bundles Nov 13, 2025
@trancexpress
Copy link
Contributor Author

Lets merge this, its probably the most simple fix for the test errors.

bundles

Launching org.eclipse.pde.junit.runtime.tests.JUnitRuntimeTests or
org.eclipse.pde.ui.tests.launcher.PluginBasedLaunchTest from Eclipse
results in the following exception:

org.eclipse.core.runtime.CoreException: Launching failed. Bootstrap code
cannot be found.

Adding org.eclipse.equinox.launcher to the required bundles of
org.eclipse.pde.junit.runtime.tests and org.eclipse.pde.ui.tests avoids
these errors.

Fixes: eclipse-pde#2024
@laeubi
Copy link
Contributor

laeubi commented Nov 19, 2025

Lets merge this, its probably the most simple fix for the test errors.

If it is only in the IDE execution, we actually should not merge it but check what requirements are missing then (like for P2) as otherwhise this will soon be marked as unused and removed again if the verification builds do not fail.

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

Successfully merging this pull request may close these issues.

Launching JUnitExecutionTest runs into odd errors

4 participants