Community
Participate
Working Groups
Created from bug 219069. JUnit plug-in tests that are run unattended, as part of release engineering builds, do not give any feedback about unhandled event loop exceptions (unless one would investigate the Workbench .log file in the workspace). This makes it hard to find and diagnose problems in unit tests, which are really caused by some completely different component; it also lets potential problems in the event loop unnoticed, which would otherwise surface and be found more easily. This report is created from bug 219069, where a unit test called JobManager.join() which runs in a nested event loop. In the event loop, an exception occurred which eventually made the test fail; but the reason for failure was very hard to find, because the event loop exception is only logged to the Workbench Log. I think the exception should also surface to the test runner, at least as part of the console output. What happens internally, is that PDE Unittest creates a UITestApplication; this creates a nested IDEApplication; the IDEApplication creates an IDEWorkbenchAdvisor; the IDEWorkbenchAdvisor uses default functionality in WorkbenchAdvisor.eventLoopException() which just logs the error by default. I think that the UITestApplication should register a modified status handler which not only logs the error, but also prints it to stdout or throws it into the calling unit test. Being able to set such a status handler might require and API change. Workaround: in the Launch for PDE Unittests, enable tracing for org.eclipse.ui.workbench/debug or run unattended builds with -debug and a related .options file. The drawback of this workaround is, that (a) the exception is only printed so it's not really handled by the unittest framework; and, (b) switching on Debug Mode for the Workbench might have other unwanted side-effects.
Does adding -consoleLog as a program argument help make the errors show up in the Eclipse console?
Yes, -consoleLog is another workaround that makes the .log visible on stdout so it's visible to the unit tests. My concern is only that on the test overview pages, or when deciding whether a test has failed or not, the console logs are typically not considered. Only failed tests vs. not failed tests are considered. Therefore, unless somebody implements a pattern matcher that reads the consoleLog and converts it into AssertionFailedErrors for junit, I'd prefer a clean solution with a custom handler registered fore eventLoopException, such that these are treated properly by JUnit.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.