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

Bug 165173

Summary: The execution of an AGR test suite will hang if the plug-in contains many dependencies
Product: z_Archived Reporter: amehrega
Component: TPTPAssignee: Joe Toomey <jptoomey>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P1 CC: cbmcgee, dmorris, lizdancy, paulslau
Version: unspecifiedKeywords: plan
Target Milestone: ---Flags: paulslau: review+
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 188290    
Attachments:
Description Flags
Patch to exclude plugins from classpath and deployment consideration for AGR tests
none
mylar/context/zip none

Description amehrega CLA 2006-11-20 11:40:01 EST
Steps to reproduce:

- Create a plug-in project
- Create an automated GUI test suite under the project
- Open the manifest file of the plug-in project and declare a dependency on the plug-ins of the workbench
- Launch the automated test

The execution will consistently hang at 60%.  Reducing the number of plug-ins will make the execution run normally.
Comment 1 Paul Slauenwhite CLA 2006-11-22 10:03:58 EST
Since Joe is out of office today, deferring to 4.4 and increasing the priority to P1.
Comment 2 Joe Toomey CLA 2007-02-05 10:34:15 EST
This defect is #2 on my priority list (behind https://bugs.eclipse.org/bugs/show_bug.cgi?id=145115 ), so it will definitely get in for 4.4.  Unable to contain in i1, need to push to i2.
Comment 3 Joe Toomey CLA 2007-03-22 09:11:49 EDT
The priority of this defect has not changed, but it is being deferred to i3 to allow for other work with UI changes that need to be complete in i2.
Comment 4 Paul Slauenwhite CLA 2007-05-18 16:18:35 EDT
This defect is a candidate for deferral from the 4.4 release.  If the originator has opposition, please provide an argument against this deferral.
Comment 5 Joe Toomey CLA 2007-05-21 14:19:42 EDT
Since I boldly announced in comment #2 that this would definitely get in for 4.4, I am reassigning this defect back to myself.
Comment 6 Joe Toomey CLA 2007-05-21 14:20:05 EDT
Targetting 4.4
Comment 7 Joe Toomey CLA 2007-05-21 14:32:18 EDT
DuWayne investigated this defect in i3, and with some help from Samson, determined that the failure was caused by the classpath variable becoming to long, resulting in an error launching the process (from the windows API.)

That will remain an issue for non-plugin based test types, but in the case of AGR (and also JUnit Plugin), the dependant plugins that are not part of the workspace don't need to be put on the classpath at all -- they will be loaded by the eclipse classloader from the target workbench location.  For that same reason, these plugins also need not be deployed.

I debugged into the deployment code and found that there was already special code added to handle this case for JUnit plugin tests (in the ArtifactUtil class).  A simple fix to also handle AGR tests in the same manner fixes this problem, though it's somewhat inelegant.  A more elegant solution would be to slightly refactor the JavaExecutionDeployment adapter, and then extend it with a WorkbenchDeploymentAdapater (that would then be regsietered as the deployment adapter for both JUnit plugin and AGR test types.)  The simple fix I am attaching here is very low risk, and will address the problem for 4.4.  I will file a separate defect to refactor the deployment adapters in 4.5.
Comment 8 Joe Toomey CLA 2007-05-21 14:34:45 EDT
Created attachment 68011 [details]
Patch to exclude plugins from classpath and deployment consideration for AGR tests
Comment 9 Joe Toomey CLA 2007-05-21 14:34:49 EDT
Created attachment 68012 [details]
mylar/context/zip
Comment 10 Paul Slauenwhite CLA 2007-05-22 09:02:24 EDT
(In reply to comment #7)
> I will
> file a separate defect to refactor the deployment adapters in 4.5.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=188290

Comment 11 Paul Slauenwhite CLA 2007-05-22 09:03:48 EDT
(In reply to comment #8)
> Created an attachment (id=68011) [details]
> Patch to exclude plugins from classpath and deployment consideration for AGR
> tests
> 

Question: Would this fix also apply for the other test types as well?

Answer: No -- the fix is to prevent us from deploying, or including on the classpath, jar files from workbench plugins.  If you consider two different types of java based tests, those that execute within a workbench and those that don't, only for the former can we get away with not deploying and putting on the classpath.  This is b/c the jar files are already in the target workbench, and they'll be loaded by the eclipse classloaders (meaning our classpath changes were ignored anyway.)  For non-workbench based test types (like normal JUnit), we still need to deploy those jars and put them on the classpath. The code already had this exclusion for JUnit plugin test type.  I just added code to make the same change for AGR.

Comment 12 Paul Slauenwhite CLA 2007-05-22 09:06:44 EDT
Patch reviewed.

Please make a request to the Test Project mailing list for this defect. 

Once the fix is integrated, please add a comment to this defect containing the build ID of the driver used to verify the fix before marking the defect as fixed.
Comment 13 Joe Toomey CLA 2007-05-23 10:19:56 EDT
Fix delivered.  Will validate and close with next build.
Comment 14 Joe Toomey CLA 2007-05-23 10:24:40 EDT
Adding hours worked for DuWayne and I
Comment 15 Joe Toomey CLA 2007-05-25 09:46:28 EDT
Validated in TPTP-4.4.0-200705250100