Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 355152

Summary: Performance improvement for UsageTest suite
Product: [Eclipse Project] PDE Reporter: Curtis Windatt <curtis.windatt.public>
Component: API ToolsAssignee: PDE API Tools Inbox <pde-apitools-inbox>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ankur_sharma, daniel_megert, Michael_Rennie, Olivier_Thomann
Version: 3.7Flags: daniel_megert: review+
Target Milestone: 3.7.1   
Hardware: PC   
OS: Linux   
Whiteboard:
Bug Depends on: 354017    
Bug Blocks:    

Description Curtis Windatt CLA 2011-08-18 15:23:58 EDT
+++ This bug was initially created as a clone of Bug #354017 +++

Cloning for backporting fix(es) to 3.7.1.


testUnusedFilter1I	Failure	Wrong number of problems expected:<1> but was:<0>

junit.framework.AssertionFailedError: Wrong number of problems expected:<1> but was:<0>
at org.eclipse.pde.api.tools.builder.tests.ApiBuilderTest.assertProblems(ApiBuilderTest.java:418)
at org.eclipse.pde.api.tools.builder.tests.usage.UnusedApiProblemFilterTests.deployTest(UnusedApiProblemFilterTests.java:183)
at org.eclipse.pde.api.tools.builder.tests.usage.UnusedApiProblemFilterTests.x1(UnusedApiProblemFilterTests.java:208)
at org.eclipse.pde.api.tools.builder.tests.usage.UnusedApiProblemFilterTests.testUnusedFilter1I(UnusedApiProblemFilterTests.java:195)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:501)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:259)
at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:36)
at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:32)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
at org.eclipse.core.launcher.Main.main(Main.java:34)

testImportJavadocTestSource	Failure	the test project api component must exist in the workspace baseline

junit.framework.AssertionFailedError: the test project api component must exist in the workspace baseline
at org.eclipse.pde.api.tools.tests.AbstractApiTest.createProject(AbstractApiTest.java:147)
at org.eclipse.pde.api.tools.util.tests.ProjectCreationTests.setUp(ProjectCreationTests.java:60)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:501)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:259)
at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:36)
at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:32)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
at org.eclipse.core.launcher.Main.main(Main.java:34)
Comment 1 Curtis Windatt CLA 2011-08-18 15:31:33 EDT
With 3.7.1 RC2 coming up fast and the git migration happening tomorrow, I want to start looking at backporting this now.

Olivier or Dani, can one of you review the fix (attachment on 354017 or see the change in HEAD to UsageTest.java).

The fix does not get to the root of the intermittent failures (which has existed for at least 2 releases), but vastly improves the performance of the usage tests and prevents the failure from occuring by reducing the number of times the projects are created.

If you approve the fix, feel free to commit to 3.7 maintenance so that we have all 3.7.1 fixes in before the git migration happens.
Comment 2 Dani Megert CLA 2011-08-19 05:29:51 EDT
The patch works and does a good job:
  UsageTest suite without patch: 933.801s
  UsageTest suite with patch: 59.179

In 3.8 I would rework (separate) the code that creates and modifies the environment during setup, so that we can avoid slightly different behavior of the first vs. the following runs.
Comment 3 Curtis Windatt CLA 2011-08-25 15:04:04 EDT
The tests pass locally and in the M20110824-0800