Bug 166977 - [vista] Unexpected errors while running JDT/Core tests
Summary: [vista] Unexpected errors while running JDT/Core tests
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 3.2.2   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-06 12:53 EST by Frederic Fusier CLA
Modified: 2007-04-02 12:39 EDT (History)
4 users (show)

See Also:


Attachments
Patch to reduce the number of errors (15.45 KB, patch)
2006-12-06 13:40 EST, Frederic Fusier CLA
no flags Details | Diff
Failures while running tests (447.17 KB, application/octet-stream)
2006-12-07 04:43 EST, Frederic Fusier CLA
no flags Details
Proposed patch for 3.3 (58.53 KB, patch)
2006-12-20 11:00 EST, Frederic Fusier CLA
no flags Details | Diff
Proposed patch for 3.2.2 (58.01 KB, patch)
2006-12-20 11:19 EST, Frederic Fusier CLA
no flags Details | Diff
Proposed patch for 3.0.2 (44.77 KB, patch)
2007-03-30 07:11 EDT, Frederic Fusier CLA
no flags Details | Diff
Proposed patch for 3.1.2 (47.93 KB, patch)
2007-04-02 12:39 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 Frederic Fusier CLA 2006-12-06 12:53:49 EST
Using Windows Vista Ultimate version and Eclipse build I20061129-1340, I20061205-1200.

Create a new workpsace and check-out following projects in it:
 - org.eclipse.jdt.core
 - org.eclipse.jdt.core.tests.compiler

Run JUnit test case org.eclipse.jdt.core.tests.compiler.regression.TestAll. After a while you got several errors NPE, FileNotFoundException (Access Denied) on some tests (I'll attach an example of these failures)...

Note that if you run the failing JUnit tests case classes individually, you cannot reproduce these failures. Running whole tests again do not produce exactly same errors but similar ones...

I've run these tests using different VMs:
 + Sun: 1.4.2_13-b06, 1.5.0_10-b02, 1.6.0-rc-b104
 + IBM: build 1.4.2, J2RE 1.4.2 IBM Windows 32 build cn142-20040828
        (JIT enabled: jitc)
Comment 1 Frederic Fusier CLA 2006-12-06 13:22:11 EST
Unfortunately my Vista box just crashed :-( and so, I won't be able to attach failures I got with all these VMs...
Comment 2 Frederic Fusier CLA 2006-12-06 13:40:34 EST
Created attachment 55152 [details]
Patch to reduce the number of errors

Fortunately, I saved my patches on my thinkpad... :-)

This patch retries the operation when directory/file creation/deletion failed for an unknown reason and also prints log in console when it happens.
I succeeded to pass all JDT/Core tests (and so compiler ones) without any error with this patch (but it happens only once!).

I have some other patches to test variations on these changes but unfortunately I cannot get any interesting conclusions before my box was broken...
Comment 3 Frederic Fusier CLA 2006-12-07 04:43:46 EST
Created attachment 55199 [details]
Failures while running tests

Hopefully, my Vista box magically restarts this morning and I retrieved my logs... :-)

There are 4 files in this zip each one contains failures list while running tests with different VMs. You can see that if these failures are similar, they are not exactly the same ones...
Comment 4 Frederic Fusier CLA 2006-12-20 11:00:11 EST
Created attachment 55967 [details]
Proposed patch for 3.3

With this patch I do not get any failures while running JDT/Core tests without any change in org.eclipse.jdt.core project, but only in org.eclipse.jdt.core.tests.* ones...

To summarize: tests do not use any longer java.io.File.delete() directly but org.eclipse.jdt.core.tests.util.Util.delete(File) instead. This method _systematically_ verifies that file has been *really* deleted from file system before returns. In case not, it waits and retry to delete if the file exists while 10 seconds maximum.

Note that when this happens, debug information may be available in console if tracing has been activated on org.eclipse.jdt.core.tests plugin. Also maximum time to wait before give up while deleting may be changed from 1 second to 1 minute using the debug/delete/wait value in this plugin .options file...
Comment 5 Frederic Fusier CLA 2006-12-20 11:17:34 EST
Released for 3.3 M5 in HEAD stream.
Comment 6 Frederic Fusier CLA 2006-12-20 11:18:17 EST
Need also to be fixed in R3_2_maintenance stream
Comment 7 Frederic Fusier CLA 2006-12-20 11:19:32 EST
Created attachment 55972 [details]
Proposed patch for 3.2.2
Comment 8 Frederic Fusier CLA 2006-12-20 11:28:01 EST
Released for 3.2.2 in R3_2_maintenance stream.
Comment 9 Andrey Loskutov CLA 2006-12-21 04:01:54 EST
Sorry for offtopic, does comment 4 mean, that anybody who uses java.io.File.delete() on Vista, MUST verify & then retry delete()? 

Is it caused by new bug/feature of Vista, some kind of "delayed/async" delete?
Comment 10 Frederic Fusier CLA 2006-12-21 05:10:06 EST
(In reply to comment #9)
> Sorry for offtopic, does comment 4 mean, that anybody who uses
> java.io.File.delete() on Vista, MUST verify & then retry delete()? 
> 
> Is it caused by new bug/feature of Vista, some kind of "delayed/async" delete?
> 
I'm not a Vista specialist and cannot really answer this question, but using Process Monitor (procmon.exe) while running our tests shows that tons of DELETE PENDING appears rapidly and explains our troubles...

The measure I've done showed that most of times, the file really disappear after between 10 and 50ms. So, you'll face this problem if you try to recreate the same file before this delay expired. This test case should not be so common, but may sometime happens - as for us. Note that we currently are the only eclipse component which such problems on Vista... Note also that it may be dependent on test box, but I really had not enough to continue the investigation deeper, only wrote a workaround to be sure our test will ever pass...

I did not see any similar issue on Vista forums (but perhaps missed them...), but if you have any other information, they will be welcomed :-)
Comment 11 Frederic Fusier CLA 2007-01-15 09:35:06 EST
Verified for 3.2.2 using build M20070112-1200.
Comment 12 Frederic Fusier CLA 2007-03-30 07:11:05 EDT
Created attachment 62475 [details]
Proposed patch for 3.0.2

This patch can be applied on top of R3_0_2
Comment 13 Frederic Fusier CLA 2007-03-30 07:13:17 EDT
(In reply to comment #12)
> Created an attachment (id=62475) [details]
> Proposed patch for 3.0.2
> 
> This patch can be applied on top of R3_0_2
> 
This patch has been released in R3_0_2_patches branch which has been versionned as v_454a_R30x.
Comment 14 Frederic Fusier CLA 2007-03-30 12:15:20 EDT
(In reply to comment #12)
> Created an attachment (id=62475) [details]
> Proposed patch for 3.0.2
> 
> This patch can be applied on top of R3_0_2
> 
This patch has been also released in R3_0_maintenance stream.
Comment 15 Frederic Fusier CLA 2007-04-02 12:39:35 EDT
Created attachment 62679 [details]
Proposed patch for 3.1.2

R3_1_2_patches branch has been created, patch released in this branch and versionned as v_585a_R312x.

Patch also released in R3_1_maintenance stream.