Bug 274332 - jdt.core.model tests take 2 hours to finish on the mac
Summary: jdt.core.model tests take 2 hours to finish on the mac
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 RC1   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-29 12:05 EDT by Kim Moir CLA
Modified: 2009-05-14 12:16 EDT (History)
2 users (show)

See Also:
Olivier_Thomann: review+


Attachments
Proposed patch (2.00 KB, patch)
2009-04-30 11:30 EDT, Frederic Fusier CLA
no flags Details | Diff
New proposed patch (2.61 KB, patch)
2009-05-03 04:26 EDT, Frederic Fusier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kim Moir CLA 2009-04-29 12:05:30 EDT
This is delaying the test results for the rest of the build.  On other platforms, they only take about 10 minutes.  

Don't know if looking at the log is helpful

http://download.eclipse.org/eclipse/downloads/drops/I20090428-0100/testresults/macosx.cocoa.x86_5.0/org.eclipse.jdt.core.tests.model.AllJavaModelTests.txt
Comment 1 Kent Johnson CLA 2009-04-29 14:10:35 EDT
We are failing to delete the test project's files after each test in org.eclipse.jdt.core.tests.model.ClasspathTests even after a 10 second delay

this is the stack of the timeout:

o.e.jdt.core.tests.util.Util.waitUntilResourceDeleted(1255)
o.e.jdt.core.tests.util.Util.delete(419)
o.e.jdt.core.tests.model.AbstractJavaModelTests.deleteResource(1676)
o.e.jdt.core.tests.model.AbstractJavaModelTests.deleteProject(1645)
o.e.jdt.core.tests.model.ClasspathTests.testOutputFolder1(5283)


ClasspathTests has not changed since Feb.10th

And in the Util class, the static method waitUntilResourceDeleted() was made public (from private) on April 21st - but that shouldn't matter.
Comment 2 Kent Johnson CLA 2009-04-29 14:47:04 EDT
Looking at the individual test times ( search for 4.1 ), we start to see times of 4.172 & .541 seconds

http://download.eclipse.org/eclipse/downloads/drops/I20090428-0100/testresults/html/org.eclipse.jdt.core.tests.model_macosx.cocoa.x86_5.0.html


10 pages of tests that all say they take over .5 second

Some of the test classes are :

ASTRewritingExpressionsTest
ASTRewritingMethodDeclTest
ASTRewritingStatementsTest
ImportRewriteTest
ASTRewritingWithStatementsRecoveryTest
Comment 3 Kent Johnson CLA 2009-04-29 15:08:28 EDT
Forget about comment #2, those same tests take around .5 second in 3.5M6

In M6 the 3164 org.eclipse.jdt.core.tests.dom tests take 181.046 - so 3 hours!

now the 3186 org.eclipse.jdt.core.tests.dom tests take 178.480

So we're actually a litte faster ;)


M3 : 3149 dom tests took 167.917

3.4 : 3111 dom tests took 212.373
Comment 4 Frederic Fusier CLA 2009-04-30 05:34:36 EDT
Kent, the problem is not on DOM/AST tests but rather on Java Model ones which have no results at all!

If you look at the test results page you see that there are results only for two packages:
org.eclipse.jdt.core.tests	1795	0	0	17.074
org.eclipse.jdt.core.tests.dom	3186	0	0	176.885

Although we're expecting to have three packages, e.g. the results of windows box:
org.eclipse.jdt.core.tests		1795	0	0	32.469
org.eclipse.jdt.core.tests.dom		3186	0	0	215.735
org.eclipse.jdt.core.tests.model	6656	0	0	702.406
Comment 5 Frederic Fusier CLA 2009-04-30 05:37:46 EDT
Note that the results disappeared between 3.5M1 and 3.5M2...
Comment 6 Frederic Fusier CLA 2009-04-30 09:38:30 EDT
OK, I think I get it. It seems that the origin of the problem is the testReadOnly() test of ClasspathTests. This test creates a project "P" and sets the .classpath file as read-only. At the end it deletes the project and I assume that on MacOSX, the folder cannot be removed as one of its file is read-only.

The problem is that the method to delete the folder retries during 10s to remove it and this method is unfortunately called 60 times! So, 1O minutes is spent in this test trying to remove the created project.

More unfortunate is that some following tests uses the same project name "P" and also try to remove it when they finish. As this project was not deleted on previous test, each of the subsequent tests also lasts 10 minutes trying to remove this same irremovable folder.. :-(

The time-out is 7200 seconds for each test Ant target, hence the execution gives up after 12 tests. Unfortunately, it  seems that the XML formatter used to run the tests does not flush at any time, hence no XML is produced and the final tests results looks correct although it should not...
Comment 7 Frederic Fusier CLA 2009-04-30 11:30:01 EDT
Created attachment 133952 [details]
Proposed patch

Just make the .classpath readable before deleting the project should be enough to fix the problem...
Comment 8 Frederic Fusier CLA 2009-05-03 04:26:08 EDT
Created attachment 134170 [details]
New proposed patch

This patch also reduces time to wait for resource to be deleted while running model tests from 10 to 1 minute...
Comment 9 Frederic Fusier CLA 2009-05-03 04:27:03 EDT
Olivier, could you please review?
Thanks
Comment 10 Olivier Thomann CLA 2009-05-04 17:10:37 EDT
+1. Releasing since Frédéric is in vacations.
Comment 11 Olivier Thomann CLA 2009-05-14 12:16:43 EDT
Verified for 3.5RC1 using I20090512-2000.