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

Bug 378787

Summary: [model] [test] testMissingClasspath fails on test machine
Product: [Eclipse Project] JDT Reporter: Satyam Kandula <satyam.kandula>
Component: CoreAssignee: Jay Arthanareeswaran <jarthana>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: amj87.iitr, david_williams, jarthana, manoj.palat, markus.kell.r, shankhba, srikanth_sankaran, stephan.herrmann
Version: 3.8   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Satyam Kandula CLA 2012-05-08 03:10:11 EDT
testMissingClasspath fails on all os's of hudson machines

Look at
http://download.eclipse.org/eclipse/downloads/drops4/S-4.2M7-201205031800/testresults/html/org.eclipse.jdt.core.tests.model_linux.gtk.x86_6.0.html.

The error message is 
##############
Unexpected markers. ----------- Expected ------------ Unable to read '.classpath' file of project 'P' ------------ but was ------------ --------- Difference is ---------- expected:<[Unable to read '.classpath' file of project 'P']> but was:<[]>
junit.framework.ComparisonFailure: Unexpected markers.
----------- Expected ------------
Unable to read '.classpath' file of project 'P'
------------ but was ------------

--------- Difference is ----------
expected:<[Unable to read '.classpath' file of project 'P']> but was:<[]>
at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertStringEquals(TestCase.java:230)
at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertEquals(TestCase.java:206)
at org.eclipse.jdt.core.tests.model.AbstractJavaModelTests.assertMarkers(AbstractJavaModelTests.java:718)
at org.eclipse.jdt.core.tests.model.AbstractJavaModelTests.assertMarkers(AbstractJavaModelTests.java:691)
at org.eclipse.jdt.core.tests.model.ClasspathTests.testMissingClasspath(ClasspathTests.java:4324)
at org.eclipse.jdt.core.tests.model.SuiteOfTestCases$Suite.runTest(SuiteOfTestCases.java:100)
at org.eclipse.jdt.core.tests.model.SuiteOfTestCases$Suite.superRun(SuiteOfTestCases.java:84)
at org.eclipse.jdt.core.tests.model.SuiteOfTestCases$1.protect(SuiteOfTestCases.java:72)
at org.eclipse.jdt.core.tests.model.SuiteOfTestCases$Suite.run(SuiteOfTestCases.java:81)
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:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
at org.eclipse.core.launcher.Main.main(Main.java:34)
Comment 1 Satyam Kandula CLA 2012-05-08 04:22:18 EDT
This runs fine on my workspace..
Comment 2 Ayushman Jain CLA 2012-05-08 04:37:25 EDT
(In reply to comment #1)
> This runs fine on my workspace..

Passes for me too. Perhaps a red herring.
Comment 3 Stephan Herrmann CLA 2012-05-08 08:37:15 EDT
(In reply to comment #2)
> (In reply to comment #1)
> > This runs fine on my workspace..
> 
> Passes for me too. Perhaps a red herring.

Fine in my workspace, consistently broken also in Object Teams build. If a herring then it is pink at best :)
Comment 4 Satyam Kandula CLA 2012-05-10 06:30:59 EDT
(In reply to comment #3)
> Fine in my workspace, consistently broken also in Object Teams build. If a
> herring then it is pink at best :)
Where does the Object Teams tests run? Do you have an idea from when this could have started failing?
Comment 5 Stephan Herrmann CLA 2012-05-11 12:59:08 EDT
(In reply to comment #4)
> Where does the Object Teams tests run?

build.eclipse.org

> Do you have an idea from when this could have started failing?

Sorry, no, I forgot to record this, but most likely at the time when I adopted JDT/Core's changes from M6 to M7.

If you have an idea what information should be logged during tests I can happily try to pull out more info from the Object Teams build.
Comment 6 Jay Arthanareeswaran CLA 2012-05-16 04:02:16 EDT
I noticed a similar thing happen with the latest win-32 build (4.2). 

Steps to reproduce:
1. Create a java project
2. Close the project
3. Go to windows explorer and delete the .classpath from the project
4. Go back to Eclipse and open the project (with build automatically enabled)

There should be an error about the missing classpath but there isn't. I am suspicious about the code inside JavaProject#readFileEntriesWithException(). First the condition rscFile.exists() returns "true" but later the check file.exists() returns false. Investigating further.
Comment 7 Jay Arthanareeswaran CLA 2012-05-16 04:07:11 EDT
(In reply to comment #6)
> There should be an error about the missing classpath but there isn't. I am
> suspicious about the code inside JavaProject#readFileEntriesWithException().
> First the condition rscFile.exists() returns "true" but later the check
> file.exists() returns false. Investigating further.

Sorry, that's not what I really wanted to say. What I really meant to say was that we return an empty classpath when the classpath file doesn't exist. This results in an 'OK' status being sent to ClasspathValidation.validate().
Comment 8 Jay Arthanareeswaran CLA 2012-05-23 06:31:41 EDT
The test failure is still not reproducible locally and fails only in win-32 set-up during build. This doesn't appear to be affecting the build (despite my observations in comment #6, since I see that behavior with IDE even with older builds) 

While I am investigating further, I have disabled the tests temporarily.
Comment 9 Stephan Herrmann CLA 2012-05-24 07:33:53 EDT
(In reply to comment #8)
> The test failure is still not reproducible locally and fails only in win-32
> set-up during build.

I also see it during build&test on Linux.
Comment 10 Jay Arthanareeswaran CLA 2012-05-28 01:47:59 EDT
(In reply to comment #9)
> I also see it during build&test on Linux.

Stephan, are you seeing the failures on your machine or the build environment?
Comment 11 Stephan Herrmann CLA 2012-05-28 17:45:11 EDT
(In reply to comment #10)
> (In reply to comment #9)
> > I also see it during build&test on Linux.
> 
> Stephan, are you seeing the failures on your machine or the build environment?

build environment, headless build on build.eclipse.org, to be specific.
Comment 12 shankha banerjee CLA 2014-06-27 04:20:50 EDT
Build ID: N20140626-2000
Platform: Linux

Test Location: http://download.eclipse.org/eclipse/downloads/drops4/N20140626-2000/testresults/html/org.eclipse.jdt.core.tests.model_linux.gtk.x86_64_8.0.html

Failed again.

Thanks
Comment 13 shankha banerjee CLA 2014-06-28 05:04:11 EDT
Location: http://download.eclipse.org/eclipse/downloads/drops4/N20140627-2000/testresults/html/org.eclipse.jdt.core.tests.model_linux.gtk.x86_64_8.0.html

Build ID: N20140627-2000
Platform: Linux

Failed again.
Comment 15 David Williams CLA 2014-06-30 03:32:45 EDT
Was the test just newly re-enabled? Seems for fail consistently each N-build, on all platforms ... ever sense we restarted builds after Luna release.
Comment 16 Manoj N Palat CLA 2014-07-14 04:15:26 EDT
*** Bug 438507 has been marked as a duplicate of this bug. ***
Comment 17 Markus Keller CLA 2014-07-21 13:18:00 EDT
(From bug 438507 comment #5)
> The test is a regression test for bug 39877, and the implementation looks
> valid to me. It would be good to know why the test fails. It is green
> locally, even when I add an explicit
> 		preferences.setAutoBuilding(...);
> with false or true.

The test has been disabled with bug 438507 comment 4 (on 2014-06-30).
Comment 18 Eclipse Genie CLA 2020-03-31 04:01:51 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.