Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-13973

Test failures in Kepler >= M6

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Done
    • Major
    • 4.1.0.Beta1
    • 4.1.0.Alpha2
    • arquillian

    Description

      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/JBossTools_Trunk/job/jbosstools-server_master/256/testReport/junit/org.jboss.ide.eclipse.archives.test.model/ModelTruezipBridgeTest/testFlattenedFileset/
      https://jenkins.mw.lab.eng.bos.redhat.com/hudson/view/JBossTools/view/JBossTools_4.1.kepler/job/jbosstools-hibernate_41/42/testReport/junit.framework/TestSuite/org_jboss_tools_hibernate_jpt_core_test_HibernateJpaModelTests/

      The issue can be fixed as follows:

      a) add an option to the parent pom:

      --- 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>
      

      b) add the plugin_customization.ini file to the test's root folder with the following content:

      org.eclipse.ui.workbench/WORKBENCH_SAVE_INTERVAL=0
      

      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.

      --- 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();
      +	}
       }
      

      2) The following error sometimes happens:

      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)
      	...
      

      See https://jenkins.mw.lab.eng.bos.redhat.com/hudson/view/JBossTools/view/JBossTools_4.1.kepler/job/jbosstools-jst_41/lastCompletedBuild/testReport/org.jboss.tools.test.util/ProjectImportTestSetup/Palette_content/

      This can be fixed as follows:

      --- 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();
      

      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.

      Attachments

        Activity

          People

            snjeza_jira Snjezana Peco (Inactive)
            snjeza_jira Snjezana Peco (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: