Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random failure of WorkbenchPluginTest.testGetImageRegistryFromAdditionalDisplay() #1891

Closed
HeikoKlare opened this issue May 21, 2024 · 0 comments · Fixed by #1892
Closed
Assignees
Labels
bug Something isn't working test junit test related things

Comments

@HeikoKlare
Copy link
Contributor

The test case org.eclipse.ui.tests.api.WorkbenchPluginTest.testGetImageRegistryFromAdditionalDisplay fails randomly in I-Builds, e.g.,
https://download.eclipse.org/eclipse/downloads/drops4/I20240520-1800/testresults/html/org.eclipse.ui.tests_ep432I-unit-win32-java17_win32.win32.x86_64_17.html

Cannot invoke "org.eclipse.swt.widgets.Display.isDisposed()" because "display" is null

java.lang.NullPointerException: Cannot invoke "org.eclipse.swt.widgets.Display.isDisposed()" because "display" is null
at org.eclipse.ui.tests.api.WorkbenchPluginTest.disposeDisplay(WorkbenchPluginTest.java:89)
at org.eclipse.ui.tests.api.WorkbenchPluginTest.testGetImageRegistryFromAdditionalDisplay(WorkbenchPluginTest.java:54)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)

I will provide a fix. There is an obvious statement order problem leading to a race condition.

@HeikoKlare HeikoKlare added the bug Something isn't working label May 21, 2024
@HeikoKlare HeikoKlare self-assigned this May 21, 2024
@HeikoKlare HeikoKlare transferred this issue from eclipse-platform/eclipse.platform May 21, 2024
@HeikoKlare HeikoKlare added the test junit test related things label May 21, 2024
HeikoKlare added a commit to HeikoKlare/eclipse.platform.ui that referenced this issue May 21, 2024
Test test case testGetImageRegistryFromAdditionalDisplay() in
org.eclipse.ui.tests.api.WorkbenchPluginTest randomly fails because of a
race condition. A display is initialized in another thread, but the
initialization logic may access the value before it has actually been
set by the other thread. This is fixed by reordering the instructions.

Fixes eclipse-platform#1891
HeikoKlare added a commit to HeikoKlare/eclipse.platform.ui that referenced this issue May 21, 2024
Test test case testGetImageRegistryFromAdditionalDisplay() in
org.eclipse.ui.tests.api.WorkbenchPluginTest randomly fails because of a
race condition. A display is initialized in another thread, but the
initialization logic may access the value before it has actually been
set by the other thread. This is fixed by reordering the instructions.

Fixes eclipse-platform#1891
HeikoKlare added a commit to HeikoKlare/eclipse.platform.ui that referenced this issue May 21, 2024
Test test case testGetImageRegistryFromAdditionalDisplay() in
org.eclipse.ui.tests.api.WorkbenchPluginTest randomly fails because of a
race condition. A display is initialized in another thread, but the
initialization logic may access the value before it has actually been
set by the other thread. This is fixed by reordering the instructions.

Fixes eclipse-platform#1891
HeikoKlare added a commit to HeikoKlare/eclipse.platform.ui that referenced this issue May 22, 2024
Test test case testGetImageRegistryFromAdditionalDisplay() in
org.eclipse.ui.tests.api.WorkbenchPluginTest randomly fails because of a
race condition. A display is initialized in another thread, but the
initialization logic may access the value before it has actually been
set by the other thread. This is fixed by reordering the instructions.

Fixes eclipse-platform#1891
HeikoKlare added a commit that referenced this issue May 22, 2024
Test test case testGetImageRegistryFromAdditionalDisplay() in
org.eclipse.ui.tests.api.WorkbenchPluginTest randomly fails because of a
race condition. A display is initialized in another thread, but the
initialization logic may access the value before it has actually been
set by the other thread. This is fixed by reordering the instructions.

Fixes #1891
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working test junit test related things
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant