Bug 576389 - [JUnit 5] Update to JUnit 5.8.1
Summary: [JUnit 5] Update to JUnit 5.8.1
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.22   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 4.22 M2   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: plan
: 576832 (view as bug list)
Depends on: 576314
Blocks:
  Show dependency tree
 
Reported: 2021-10-01 07:49 EDT by Noopur Gupta CLA
Modified: 2021-10-23 08:03 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Noopur Gupta CLA 2021-10-01 07:49:16 EDT
JUnit 5.8.1 has been released on September 22, 2021:
https://junit.org/junit5/docs/5.8.1/release-notes/

JDT should update to JUnit 5.8.1.
Comment 1 Noopur Gupta CLA 2021-10-20 06:05:11 EDT
The module org.junit.platform.suite.commons has been newly added in JUnit 5.8.1 and needs to be added to JDT code.

See bug 576314 for details.

The above will need to be added to PDE as well most probably. Adding Vikas in cc to check and update the same.
Comment 2 Eclipse Genie CLA 2021-10-20 07:49:34 EDT
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/186720
Comment 3 Eclipse Genie CLA 2021-10-20 09:09:41 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.releng.aggregator/+/186723
Comment 4 Eclipse Genie CLA 2021-10-20 09:12:05 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.common/+/186725
Comment 5 Eclipse Genie CLA 2021-10-20 09:18:40 EDT
New Gerrit change created: https://git.eclipse.org/r/c/equinox/rt.equinox.p2/+/186726
Comment 6 Noopur Gupta CLA 2021-10-20 09:30:20 EDT
The above patches are ready for submission and should be submitted at the same time (along with the PDE patch).
Comment 7 Noopur Gupta CLA 2021-10-21 09:40:12 EDT
(In reply to Noopur Gupta from comment #1)
> The above will need to be added to PDE as well most probably. Adding Vikas
> in cc to check and update the same.
Vikas, can we have the PDE patch to release these for M2?
Comment 8 Vikas Chandra CLA 2021-10-21 11:49:07 EDT
*(In reply to Noopur Gupta from comment #7)
> (In reply to Noopur Gupta from comment #1)
> > The above will need to be added to PDE as well most probably. Adding Vikas
> > in cc to check and update the same.
> Vikas, can we have the PDE patch to release these for M2?


PDE doesnt have reference to  org.junit.platform.suite.* (  org.junit.platform.suite.api is not present anywhere)

So I am not sure if org.junit.platform.suite.commons is to be added anywhere in PDE.

So the best strategy would be release these changes and see if JUnit5 in PDE works OK or not.
Comment 13 Vikas Chandra CLA 2021-10-21 12:28:40 EDT
Only 1 reference of org.junit.platform.suite.api in the test bundle here - /ui/org.eclipse.pde.junit.runtime.tests/test-bundles/verification.tests.junit4.platform/META-INF/MANIFEST.MF

If required, I will add org.junit.platform.suite.commons after investigation tomorrow.
Comment 14 Eclipse Genie CLA 2021-10-21 17:54:56 EDT
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/186797
Comment 16 Andrey Loskutov CLA 2021-10-22 00:28:52 EDT
Looks like that we have a problem with this update, there are 15 test fails

https://download.eclipse.org/eclipse/downloads/drops4/I20211021-1800/testresults/html/org.eclipse.pde.junit.runtime.tests_ep422I-unit-cen64-gtk3-java11_linux.gtk.x86_64_11.html

most of them with similar error:

java.lang.AssertionError: test application could not start:

!SESSION 2021-10-22 00:40:08.278 -----------------------------------------------
eclipse.buildId=unknown
java.version=11.0.11
java.vendor=AdoptOpenJDK
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments: -version 3 -port 36109 -testLoaderClass org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader -loaderpluginname org.eclipse.jdt.junit5.runtime -packageNameFile /home/jenkins/agent/workspace/ep422I-unit-cen64-gtk3-java11/tmp/packageNames11483227928643042215.txt -application org.eclipse.pde.junit.runtime.coretestapplication -testpluginname verification.tests.junit5
Command-line arguments: -os linux -ws gtk -arch x86_64 -consoleLog -version 3 -port 36109 -testLoaderClass org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader -loaderpluginname org.eclipse.jdt.junit5.runtime -packageNameFile /home/jenkins/agent/workspace/ep422I-unit-cen64-gtk3-java11/tmp/packageNames11483227928643042215.txt -application org.eclipse.pde.junit.runtime.coretestapplication -data /home/jenkins/agent/workspace/ep422I-unit-cen64-gtk3-java11/workarea/I20211021-1800/eclipse-testing/test-eclipse/eclipse/pde_sniff_folder/verification.tests.junit5.fragment_verification.tests.junit5.fragment/workspace -dev file:/home/jenkins/agent/workspace/ep422I-unit-cen64-gtk3-java11/workarea/I20211021-1800/eclipse-testing/test-eclipse/eclipse/pde_sniff_folder/verification.tests.junit5.fragment_verification.tests.junit5.fragment/configuration/dev.properties -os linux -ws gtk -arch x86_64 -consoleLog -testpluginname verification.tests.junit5

!ENTRY org.eclipse.osgi 4 0 2021-10-22 00:40:10.952
!MESSAGE Application error
!STACK 1
java.util.ServiceConfigurationError: org.junit.platform.launcher.TestExecutionListener: org.junit.platform.launcher.listeners.UniqueIdTrackingListener not a subtype
at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:589)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1237)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1265)
at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1300)
at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1385)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:132)
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
at org.junit.platform.launcher.core.LauncherFactory.registerTestExecutionListeners(LauncherFactory.java:179)
at org.junit.platform.launcher.core.LauncherFactory.createDefaultLauncher(LauncherFactory.java:137)
at org.junit.platform.launcher.core.LauncherFactory.create(LauncherFactory.java:125)
at org.junit.platform.launcher.core.LauncherFactory.create(LauncherFactory.java:109)
at org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader.<init>(JUnit5TestLoader.java:34)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at java.base/java.lang.Class.newInstance(Class.java:584)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.createRawTestLoader(RemoteTestRunner.java:371)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.createLoader(RemoteTestRunner.java:366)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.defaultInit(RemoteTestRunner.java:310)
at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.init(RemotePluginTestRunner.java:204)
at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:107)
at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.start(CoreTestApplication.java:28)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
at org.eclipse.equinox.launcher.Main.main(Main.java:1440)
at org.junit.Assert.fail(Assert.java:89)
at org.eclipse.pde.junit.runtime.tests.TestExecutionUtil.checkExitValueAndDumpLog(TestExecutionUtil.java:164)
at org.eclipse.pde.junit.runtime.tests.TestExecutionUtil.launchAndWaitForTermination(TestExecutionUtil.java:144)
at org.eclipse.pde.junit.runtime.tests.TestExecutionUtil.runTest(TestExecutionUtil.java:81)
at org.eclipse.pde.junit.runtime.tests.JUnitExecutionTest.executePackage(JUnitExecutionTest.java:106)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
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.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.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.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
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.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:42)
at org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:80)
at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:72)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)
at org.eclipse.test.EclipseTestRunner.runTests(EclipseTestRunner.java:226)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:202)
at org.eclipse.test.UITestApplication.lambda$0(UITestApplication.java:103)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:5106)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4584)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1041)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
Comment 17 Andrey Loskutov CLA 2021-10-22 00:57:22 EDT
(In reply to Noopur Gupta from comment #1)
> The module org.junit.platform.suite.commons has been newly added in JUnit
> 5.8.1 and needs to be added to JDT code.
> 
> See bug 576314 for details.
> 
> The above will need to be added to PDE as well most probably. Adding Vikas
> in cc to check and update the same.

See bug 576832
Comment 18 Eclipse Genie CLA 2021-10-22 01:02:08 EDT
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt/+/186802
Comment 20 Noopur Gupta CLA 2021-10-22 01:03:50 EDT
*** Bug 576832 has been marked as a duplicate of this bug. ***
Comment 21 Noopur Gupta CLA 2021-10-22 01:04:32 EDT
(In reply to Eclipse Genie from comment #19)
> Gerrit change https://git.eclipse.org/r/c/jdt/eclipse.jdt/+/186802 was
> merged to [master].
> Commit:
> http://git.eclipse.org/c/jdt/eclipse.jdt.git/commit/?id=d2a6ebba9063f3bba120a5c0c5c4dd4035a053ae
> 
This should fix bug 576832.
Comment 22 Andrey Loskutov CLA 2021-10-22 01:10:26 EDT
(In reply to Noopur Gupta from comment #21)
> (In reply to Eclipse Genie from comment #19)
> > Gerrit change https://git.eclipse.org/r/c/jdt/eclipse.jdt/+/186802 was
> > merged to [master].
> > Commit:
> > http://git.eclipse.org/c/jdt/eclipse.jdt.git/commit/?id=d2a6ebba9063f3bba120a5c0c5c4dd4035a053ae
> > 
> This should fix bug 576832.

Do we need a rebuild for 4.22 M2? I'm not sure if the yesterday's build was planned for M2 or today's.
Comment 23 Eclipse Genie CLA 2021-10-22 01:16:34 EDT
New Gerrit change created: https://git.eclipse.org/r/c/pde/eclipse.pde.ui/+/186803
Comment 25 Kit Lo CLA 2021-10-22 01:28:37 EDT
We will use I20211020-1800 as Eclipse 4.22 M2.
Comment 26 Andrey Loskutov CLA 2021-10-22 01:32:01 EDT
(In reply to Kit Lo from comment #25)
> We will use I20211020-1800 as Eclipse 4.22 M2.

This is unfortunate, because there were few interesting changes submitted yesterday, marked as resolved for M2. 

Seeing now the two fixes from Vikas/Noopur are merged, can we re-trigger the SDK build now and if that works, use that build?
Comment 27 Noopur Gupta CLA 2021-10-22 01:34:48 EDT
(In reply to Andrey Loskutov from comment #26)
> Seeing now the two fixes from Vikas/Noopur are merged, can we re-trigger the
> SDK build now and if that works, use that build?
We can start a new I-build anyway now and decide based on how it goes.
Comment 28 Andrey Loskutov CLA 2021-10-22 01:35:30 EDT
(In reply to Noopur Gupta from comment #27)
> (In reply to Andrey Loskutov from comment #26)
> > Seeing now the two fixes from Vikas/Noopur are merged, can we re-trigger the
> > SDK build now and if that works, use that build?
> We can start a new I-build anyway now and decide based on how it goes.

Yes! Also would be good to have JUnit 5.8.1 (this bug) in M2.
Comment 29 Kit Lo CLA 2021-10-22 01:39:40 EDT
I started a new I-build to test out the fix.
Comment 30 Eclipse Genie CLA 2021-10-22 03:51:13 EDT
New Gerrit change created: https://git.eclipse.org/r/c/simrel/org.eclipse.simrel.build/+/186811
Comment 31 Kit Lo CLA 2021-10-22 03:54:21 EDT
New build I20211022-0130 now includes org.junit.platform.suite.commons 1.8.1.v20211018-1956
Comment 32 Vikas Chandra CLA 2021-10-22 04:23:04 EDT
In Build id: I20211022-0130 too, running JUnit5 in a PDE project fails with the same stack trace.

@Julian, do you any ideas ?
Comment 33 Andrey Loskutov CLA 2021-10-22 06:38:28 EDT
(In reply to Vikas Chandra from comment #32)
> In Build id: I20211022-0130 too, running JUnit5 in a PDE project fails with
> the same stack trace.

Yep, tests are still failing:

https://download.eclipse.org/eclipse/downloads/drops4/I20211022-0130/testresults/html/org.eclipse.pde.junit.runtime.tests_ep422I-unit-cen64-gtk3-java11_linux.gtk.x86_64_11.html

java.lang.AssertionError: test application could not start:

!SESSION 2021-10-22 08:06:21.783 -----------------------------------------------
eclipse.buildId=unknown
java.version=11.0.11
java.vendor=AdoptOpenJDK
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments: -version 3 -port 35045 -testLoaderClass org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader -loaderpluginname org.eclipse.jdt.junit5.runtime -test verification.tests.junit4.platform.Test1:test1 -application org.eclipse.pde.junit.runtime.coretestapplication -testpluginname verification.tests.junit4.platform
Command-line arguments: -os linux -ws gtk -arch x86_64 -consoleLog -version 3 -port 35045 -testLoaderClass org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader -loaderpluginname org.eclipse.jdt.junit5.runtime -test verification.tests.junit4.platform.Test1:test1 -application org.eclipse.pde.junit.runtime.coretestapplication -data /home/jenkins/agent/workspace/ep422I-unit-cen64-gtk3-java11/workarea/I20211022-0130/eclipse-testing/test-eclipse/eclipse/pde_sniff_folder/verification.tests.junit4.platform_Test1.test1/workspace -dev file:/home/jenkins/agent/workspace/ep422I-unit-cen64-gtk3-java11/workarea/I20211022-0130/eclipse-testing/test-eclipse/eclipse/pde_sniff_folder/verification.tests.junit4.platform_Test1.test1/configuration/dev.properties -os linux -ws gtk -arch x86_64 -consoleLog -testpluginname verification.tests.junit4.platform

!ENTRY org.eclipse.osgi 4 0 2021-10-22 08:06:24.547
!MESSAGE Application error
!STACK 1
java.util.ServiceConfigurationError: org.junit.platform.launcher.TestExecutionListener: org.junit.platform.launcher.listeners.UniqueIdTrackingListener not a subtype
at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:589)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1237)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1265)
at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1300)
at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1385)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:132)
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
at org.junit.platform.launcher.core.LauncherFactory.registerTestExecutionListeners(LauncherFactory.java:179)
at org.junit.platform.launcher.core.LauncherFactory.createDefaultLauncher(LauncherFactory.java:137)
at org.junit.platform.launcher.core.LauncherFactory.create(LauncherFactory.java:125)
at org.junit.platform.launcher.core.LauncherFactory.create(LauncherFactory.java:109)
at org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader.<init>(JUnit5TestLoader.java:34)
Comment 34 Julian Honnen CLA 2021-10-22 06:50:58 EDT
> java.util.ServiceConfigurationError: org.junit.platform.launcher.TestExecutionListener: org.junit.platform.launcher.listeners.UniqueIdTrackingListener not a subtype
JUnit invokes a ServiceLoader to load TestExecutionListeners. This service loader is set up with PDE's MultiBundleClassLoader and the service interface is loaded with the correct bundle classloader.
So far as expected.

However, org.junit.platform.launcher is also on the app classpath. -> The service loader finds the UniqueIdTrackingListener from the AppClassLoader and then fails due to classloader mismatch.

I have the following classpath in the launched test VM. The 2nd one is the extracted org.junit.platform.launcher bundle.

java.class.path=D:\Dev\git\rt.equinox.framework\bundles\org.eclipse.equinox.launcher\bin;D:\Dev\eclipse-dev\.metadata\.plugins\org.eclipse.pde.core\Eclipse\org.eclipse.osgi\292\0\.cp
Comment 35 Julian Honnen CLA 2021-10-22 06:58:50 EDT
(In reply to Julian Honnen from comment #34)
> However, org.junit.platform.launcher is also on the app classpath.
That's happening in JUnitLaunchConfigurationDelegate:204. Once that code is disabled, the tests work again.

Seems like PDE should set ATTR_DONT_ADD_MISSING_JUNIT5_DEPENDENCY to true for all test launch configurations.
Comment 36 Julian Honnen CLA 2021-10-22 07:26:42 EDT
(In reply to Julian Honnen from comment #35)
> Seems like PDE should set ATTR_DONT_ADD_MISSING_JUNIT5_DEPENDENCY to true
> for all test launch configurations.

Alternatively
1) that block could be moved into getClasspathAndModulepath() where it would be overridden by PDE.
This is IMHO the correct solution for the broken classpath (from PDE PoV).

2) MultiBundleClassLoader should not delegate to the system classloader.
That also solves this and similar issues. I'll push a gerrit.
Comment 37 Eclipse Genie CLA 2021-10-22 07:29:05 EDT
New Gerrit change created: https://git.eclipse.org/r/c/pde/eclipse.pde.ui/+/186815
Comment 39 Vikas Chandra CLA 2021-10-22 09:42:22 EDT
Thanks Julian !

I have triggered another I build to test this and to get a build with all the JUnit5.8.1 related fixes.
Comment 40 Vikas Chandra CLA 2021-10-22 14:38:35 EDT
I20211022-0920 looks good from PDE point of view.
Comment 41 Noopur Gupta CLA 2021-10-23 08:03:35 EDT
Thanks, everyone. Closing the bug.