[MacOS] E4 SWT Addons not triggered in first executed test case with Java 21 JVM #1784
Open
2 tasks done
Labels
bug
Something isn't working
Let's make sure issue is not already fixed in latest builds first.
Steps to reproduce
When executing test cases related to E4 SWT addons, i.e., the addons in
org.eclipse.e4.ui.workbench.addons.swt
, with a Java 21 JVM on MacOS, the first executed test case fails because the addon to be tested is not triggered. More precisely, the addon is not triggered for a topic it is registered for.To reproduce, do the following:
org.eclipse.e4.ui.workbench.addons.swt.test
, such asMaximizePartSashContainerPlaceholderTest
orMaximizableChildrenTag
You will see that the first test case is always failing:
Note that this does not happen in automated master builds because as long as some E4 application has been started before the one for the test is instantiated, everything seems to work fine (as can also be seen by all subsequent test cases succeeding). The bug can be seen in automated builds of #1775, where another addon test is introduced and the condition mentioned above is not fulfilled.
Detailed information for reproduction
You can see that the addon is not triggered for the topic on which a change happens while debugging the test. For example, the
MaximizableChildrenTag.testPartStack1Max()
triggers four changes on the tags topic with a Java 17 JVM, whereas it triggers only one change on that topic with a Java 21 JVM. This can be seen by setting a breakpoint in the topic-handling method of the addon:eclipse.platform.ui/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/MinMaxAddon.java
Lines 382 to 384 in c40b7a1
A breakpoint at the functionality that is tested by the test case is not triggered with a Java 21 JVM during execution of the first test case:
eclipse.platform.ui/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/MinMaxAddon.java
Lines 728 to 731 in c40b7a1
Possible solution / workaround
I did not find a solution (as I did not find the reason for bug) so far. The only workaround is to instantiate an E4 application before executing the according test case once, e.g., by starting execution of a test class with an additional empty test case or by starting the tests under some application and not in headless mode.
Tested under this environment:
Community
The text was updated successfully, but these errors were encountered: