[
https://issues.jboss.org/browse/JBIDE-13973?page=com.atlassian.jira.plugi...
]
Mickael Istria commented on JBIDE-13973:
----------------------------------------
I'd prefer not starting to introduce custom plugin_customization.ini for test run, as
it would make tests rely on an external file, which is not a clean behavior. Instead, it
sounds better that tests set up their requirement in the @Before methods.
In my opinion, the workbench save job wouldn't need to run
forever.
Please correct me if I get it wrong, but the job is not running forever, it's just
permanently scheduled to run every 5 minutes (by default). So there is always something to
happen in JobManager. That's the second time it is happening and it is now part of the
Eclipse platform. Some future developments will simply take this as example so we'll
have the issue everytime a plugin makes such a permanently scheduled job.
In my opinion, the workbench save job wouldn't need to run
forever.
I think it's a cool feature for end-users that make that Eclipse will restore in a
better way after a crash. Saving workbench test every X minutes makes sense in term of
overall quality
Mickael, any plugin that decides to use forever running jobs we want
to avoid/kill for test runs and even in normal UI runs since it is just a waste.
I do not agree here. Having scheduled jobs is just a way of implementing some features.
Disabling them makes a difference between test environment and real usage environment that
may make tests working when runtime would not.
I'm still convinced that the issue is on our expectation to have an empty Job queue
and assuming that other projects are wrong. We could filter which jobs to kill directly in
the JobUtils rather than in the suerfire configuration. It would make it easier to run
tests locally from PDE as well (would not require some additional settings).
That said, I'm ok with setting the flag to disable this job, I just think it's not
the best solution, but it's a good enough one to be merged.
[~snjeza] Can you please make a new PR without the preferences stuff, since they're
not needed so far (keeping not needed hacks just increase maitenance cost without
providing any value).
Test failures in Kepler >= M6
------------------------------
Key: JBIDE-13973
URL:
https://issues.jboss.org/browse/JBIDE-13973
Project: Tools (JBoss Tools)
Issue Type: Feature Request
Components: testing-tools
Affects Versions: 4.1.0.Alpha2
Reporter: Snjezana Peco
Assignee: Snjezana Peco
1) Kepler M6 introduces the Workspace Save Job job. See
https://bugs.eclipse.org/bugs/show_bug.cgi?id=2369 and
https://bugs.eclipse.org/bugs/show_bug.cgi?id=402912
It would be good to add a preference that would disable this job when running tests. This
would speed up all the tests lasting more than five minutes. The 402912 bug is fixed, but
the tests will still be faster if this job doesn't run at all.
We would also avoid the "Long running tasks detected: Workbench Auto-Save Job"
failure.
The latest hibernate/server failures are mainly caused by this issue.
See
https://jenkins.mw.lab.eng.bos.redhat.com/hudson/view/JBossTools/view/JBo...
https://jenkins.mw.lab.eng.bos.redhat.com/hudson/view/JBossTools/view/JBo...
The issue can be fixed as follows:
a) add an option to the parent pom:
{code}
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -227,6 +227,7 @@
<!-- THE FOLLOWING LINE MUST NOT BE BROKEN BY
AUTOFORMATTING -->
<!-- tycho.testArgLine repeated to keep jacoco
configuration for jacoco-maven-plugin -->
<argLine>${tycho.testArgLine}
${memoryOptions1} ${memoryOptions2} ${applejdkProperties} ${platformSystemProper
+ <appArgLine>-pluginCustomization
${basedir}/plugin_customization.ini</appArgLine>
{code}
b) add the plugin_customization.ini file to the test's root folder with the following
content:
{code}
org.eclipse.ui.workbench/WORKBENCH_SAVE_INTERVAL=0
{code}
The test plugin will be also able to change other preferences.
It is also possible to generate this file automatically, but, that way, all the test
plugins would have the same preferences.
I propose to add this file to all the test plugins that take more than a half hour.
c) set the WORKBENCH_SAVE_INTERVAL property explicitly to the start method of the
org.jboss.tools.tests plugin to fix periodic the "Long running tasks detected:
Workbench Auto-Save Job" failures.
{code}
--- a/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/TestsPlugin.java
+++ b/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/TestsPlugin.java
@@ -10,7 +10,11 @@
******************************************************************************/
package org.jboss.tools.tests;
+import org.eclipse.ui.internal.IPreferenceConstants;
+import org.eclipse.ui.internal.WorkbenchPlugin;
+import org.eclipse.ui.internal.util.PrefUtil;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
/**
* @author eskimo
@@ -27,4 +31,10 @@ public class TestsPlugin extends AbstractUIPlugin {
}
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ WorkbenchPlugin.getDefault().getPreferenceStore().setValue(IPreferenceConstants.WORKBENCH_SAVE_INTERVAL,
0);
+ PrefUtil.savePrefs();
+ }
}
{code}
2) The following error sometimes happens:
{code}
org.eclipse.swt.SWTException: Failed to execute runnable
(java.lang.NullPointerException)
at org.eclipse.swt.SWT.error(SWT.java:4392)
at org.eclipse.swt.SWT.error(SWT.java:4307)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:138)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3692)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3341)
at org.jboss.tools.test.util.JobUtils.delay(JobUtils.java:58)
at org.jboss.tools.test.util.JobUtils.waitForIdle(JobUtils.java:37)
at org.jboss.tools.test.util.JobUtils.waitForIdle(JobUtils.java:31)
at org.jboss.tools.test.util.JobUtils.waitForIdle(JobUtils.java:27)
...
{code}
See
https://jenkins.mw.lab.eng.bos.redhat.com/hudson/view/JBossTools/view/JBo...
This can be fixed as follows:
{code}
--- a/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/JobUtils.java
+++ b/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/JobUtils.java
@@ -55,7 +55,7 @@ public class JobUtils {
if(PlatformUI.isWorkbenchRunning() && display!= null) {
long endTimeMillis = System.currentTimeMillis() + waitTimeMillis;
while (System.currentTimeMillis() < endTimeMillis) {
- if (!display.readAndDispatch())
+ if (PlatformUI.isWorkbenchRunning() && display != null &&
!display.readAndDispatch())
display.sleep();
}
display.update();
{code}
I suppose this error is also caused by the changes in the Kepler M6 UISynchronizer.
3) The org.jboss.ide.eclipse.archives.test.core.ant.SimpleAntTest.testOne test sometimes
fails
I think, it is necessary to add an empty file to the
/org.jboss.ide.eclipse.archives.test/inputs/projects/SimpleAntTest/output directory
because git skips empty directories.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira