Bug 188127 - [test] Some tests fail on Harmony
Summary: [test] Some tests fail on Harmony
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 RC2   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-21 12:18 EDT by Andrey Pavlenko CLA
Modified: 2007-05-25 06:35 EDT (History)
1 user (show)

See Also:


Attachments
Possible fix (2.45 KB, patch)
2007-05-22 06:21 EDT, Jerome Lanneluc CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Pavlenko CLA 2007-05-21 12:18:50 EDT
Build ID: 3.2

Steps To Reproduce:
1. build the latest Harmony jre
2. dowload EUT runniing script from jira-2038
3. update eut.properties: set test.jre.home= to Harmony jre home
4. run "ant -Dtests=jdtcorecompiler"

More information:
Some jdt tests fail on Harmony with "junit.framework.AssertionFailedError: No targetException null". AFAIU the cause of the failures is in the org.eclipse.jdt.core.tests.runtime.LocalVMLauncher.execCommandLine() method which creates a new instance of JVM but does not care if the VM has already started. Please see the following JIRA issue for more details: https://issues.apache.org/jira/browse/HARMONY-3375
Comment 1 Olivier Thomann CLA 2007-05-21 21:01:39 EDT
Could you please provide details to do steps 1 and 2?
Thanks.
Comment 2 Andrey Pavlenko CLA 2007-05-22 03:35:44 EDT
1. It's not necessary to build Harmony from svn, you could download a binary distribution from the following location - http://harmony.apache.org/downloads.html

2. You can download the script from here https://issues.apache.org/jira/browse/HARMONY-2038, but you also could omit this step.
Comment 3 Philipe Mulet CLA 2007-05-22 04:00:59 EDT
The JIRA mentions inserting a 5s pause... this feels like a hack.
Shouldn't it wait for real on the VM ?
Comment 4 Jerome Lanneluc CLA 2007-05-22 05:30:04 EDT
Indeed LocalVMLauncher.execCommandLine() doesn't wait for the VM to complete its startup (there is no API to do so). However EvaluationSetup.setUp() will try to connect to this VM during 10 seconds (see this.target.connect("localhost", evalPort, 10000);)

So it looks like no Socket could be bound to the launched VM 10 seconds after it was launched. Does the Harmony VM take that long to launch ? If so, the fix would be to increase the timeout during the connection.
Comment 5 Andrey Pavlenko CLA 2007-05-22 06:11:18 EDT
Actually the tests pass on systems with a big amount of RAM, but on my laptop with 1Gb the tests fail. I think this happens because an instance of Harmony VM "eats" ~300Mb of memory. Thus, to allocate additional 300Mb for a new instance of VM started from the tests, it's required too move some amount of data from RAM to swap that takes too much time.
Comment 6 Jerome Lanneluc CLA 2007-05-22 06:21:59 EDT
Created attachment 68092 [details]
Possible fix

This fix consists in increasing the timeout to 30 seconds.
Comment 7 Jerome Lanneluc CLA 2007-05-22 06:22:31 EDT
Could you please try the attached patch and let me know if this fixes the problem ?
Comment 8 Andrey Pavlenko CLA 2007-05-22 07:57:46 EDT
It works for me. Thanks.
Comment 9 Jerome Lanneluc CLA 2007-05-23 10:00:19 EDT
Patch released for 3.3RC2 in HEAD.
Comment 10 Frederic Fusier CLA 2007-05-25 06:35:40 EDT
Verified for 3.3 RC2 by user