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

SWTException while SWTCleanupHandler is called #2

Closed
falkzilm opened this issue Apr 26, 2016 · 5 comments
Closed

SWTException while SWTCleanupHandler is called #2

falkzilm opened this issue Apr 26, 2016 · 5 comments

Comments

@falkzilm
Copy link

Hi Fred,

today i found a curious issue in our test environment. After switching to 4.4 with our Eclipse RCP application and merging your branch to our local one i got these error at the end of every test:

Exception in thread "WT Test Thread" org.eclipse.swt.SWTException: Failed to execute runnable (org.eclipse.swt.SWTException: Widget is disposed)
[java] at org.eclipse.swt.SWT.error(SWT.java:4441)
[java] at org.eclipse.swt.SWT.error(SWT.java:4356)
[java] at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:209)
[java] at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:156)
[java] at org.eclipse.swt.widgets.Display.syncExec(Display.java:4590)
[java] at com.windowtester.runtime.swt.internal.junit.SWTCleanupHandler.closeDecendentShells(SWTCleanupHandler.java:155)
[java] at com.windowtester.runtime.swt.internal.junit.SWTCleanupHandler.closeUnexpectedShells(SWTCleanupHandler.java:106)
[java] at com.windowtester.runtime.swt.internal.junit.SWTCleanupHandler.cleanUp(SWTCleanupHandler.java:74)
[java] at com.windowtester.internal.runtime.junit.core.AbstractExecutionMonitor.cleanUp(AbstractExecutionMonitor.java:151)
[java] at com.windowtester.internal.runtime.junit.core.AbstractExecutionMonitor.testFinishing(AbstractExecutionMonitor.java:137)
[java] at com.windowtester.internal.runtime.junit.core.SequenceRunner.runFinishing(SequenceRunner.java:93)
[java] at com.windowtester.internal.runtime.junit.core.SequenceRunner.access$0(SequenceRunner.java:92)
[java] at com.windowtester.internal.runtime.junit.core.SequenceRunner$1.run(SequenceRunner.java:56)
[java] Caused by: org.eclipse.swt.SWTException: Widget is disposed
[java] at org.eclipse.swt.SWT.error(SWT.java:4441)
[java] at org.eclipse.swt.SWT.error(SWT.java:4356)
[java] at org.eclipse.swt.SWT.error(SWT.java:4327)
[java] at org.eclipse.swt.widgets.Widget.error(Widget.java:476)
[java] at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:413)
[java] at org.eclipse.swt.widgets.Text.setText(Text.java:2475)
[java] at org.eclipse.ui.internal.quickaccess.SearchField$2.doClose(SearchField.java:160)
[java] at org.eclipse.ui.internal.quickaccess.SearchField$3.shellClosed(SearchField.j

After debugging i found out, that he seems to collect some views also as Shell and trying to close them results in the thing that they are disposed... do you know of any changes regarding this?

I simply added a try/catch thing around the display.syncExec in closeDecendentShells in line 151 in the file SWTCleanupHandler, so this prevents the tests from throwing away the test result execptions in my case.

@fredg02
Copy link
Owner

fredg02 commented Apr 26, 2016

Hi Falk,
I guess you merged the "tychoWIP_e44" branch?
Can you reproduce this issue when using the latest release binaries from https://github.com/fredg02/windowtester/releases/tag/6.1.2-beta1-e44x?

I vaguely recall an issue with setText being called on the search field even though the widget is already disposed, but it's been a while since my last changes, so I'll have to do some digging:

[java] at org.eclipse.swt.widgets.Text.setText(Text.java:2475)
[java] at org.eclipse.ui.internal.quickaccess.SearchField$2.doClose(SearchField.java:160)
[java] at org.eclipse.ui.internal.quickaccess.SearchField$3.shellClosed(SearchField.j

@falkzilm
Copy link
Author

Correctly i merged the branch - Problem is i've got changes on local side which are not entirely on your side so i needed to merge branches and cannot use binaries :(

If i can help you out somehow there let me know.

@fredg02
Copy link
Owner

fredg02 commented May 2, 2016

I was right, it's a bug (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=449485). This bug has been fixed in Eclipse 4.5.

We are still working with Eclipse 4.4, that's why I've created a so called "feature patch" that includes the bug fix and gets applied to our "application under test" before testing.

Added the feature patch here: https://github.com/fredg02/windowtester/releases/download/6.1.2-beta1-e44x/featurePatch449485.zip

Note: make sure that you delete the old plugin jar (org.eclipse.ui.workbench_*.jar) from your plugins folder before applying the feature patch.

Please let me know if that works for you.

@falkzilm
Copy link
Author

Hi fred, forgot to mention that this fixed my problem :)
And with Eclipse 4.5 everything is also working fine.

@fredg02
Copy link
Owner

fredg02 commented Mar 22, 2017

Cool. Thanks for the feedback.

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

No branches or pull requests

2 participants