Bug 423280 - Failure in testAddNonJavaResourcePackageFragmentRoot (now disabled)
Summary: Failure in testAddNonJavaResourcePackageFragmentRoot (now disabled)
Status: VERIFIED DUPLICATE of bug 464369
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.4   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.6 M4   Edit
Assignee: Jay Arthanareeswaran CLA
QA Contact: Jay Arthanareeswaran CLA
URL: http://download.eclipse.org/eclipse/d...
Whiteboard:
Keywords: test
: 403414 409466 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-12-05 03:31 EST by shankha banerjee CLA
Modified: 2015-12-08 08:29 EST (History)
5 users (show)

See Also:
jarthana: review+


Attachments
Patch (1.22 KB, patch)
2014-04-18 20:29 EDT, shankha banerjee CLA
no flags Details | Diff
Patch (1013 bytes, patch)
2014-05-16 04:24 EDT, shankha banerjee CLA
shankhba: review?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description shankha banerjee CLA 2013-12-05 03:31:04 EST
BUILD ID: N20131204-2000
Test Results Location:
http://download.eclipse.org/eclipse/downloads/drops4/N20131204-2000/testresults/html/org.eclipse.jdt.core.tests.model_win32.win32.x86_7.0.html

testAddNonJavaResourcePackageFragmentRoot

incorrect non java resources. ----------- Expected ------------ /JavaProjectTests/.classpath\n /JavaProjectTests/.project\n /JavaProjectTests/.settings\n /JavaProjectTests/TestNonJavaResource.abc ------------ but was ------------ /JavaProjectTests/.classpath\n /JavaProjectTests/.project\n /JavaProjectTests/.settings --------- Difference is ---------- expected:<...ojectTests/.settings[\n /JavaProjectTests/TestNonJavaResource.abc]> but was:<...ojectTests/.settings[]>

junit.framework.ComparisonFailure: incorrect non java resources.
----------- Expected ------------
/JavaProjectTests/.classpath\n
/JavaProjectTests/.project\n
/JavaProjectTests/.settings\n
/JavaProjectTests/TestNonJavaResource.abc
------------ but was ------------
/JavaProjectTests/.classpath\n
/JavaProjectTests/.project\n
/JavaProjectTests/.settings
--------- Difference is ----------
expected:<...ojectTests/.settings[\n
/JavaProjectTests/TestNonJavaResource.abc]> but was:<...ojectTests/.settings[]>
at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertStringEquals(TestCase.java:238)
at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertEquals(TestCase.java:214)
at org.eclipse.jdt.core.tests.model.AbstractJavaModelTests.assertResourcesEqual(AbstractJavaModelTests.java:546)
at org.eclipse.jdt.core.tests.model.JavaProjectTests.testAddNonJavaResourcePackageFragmentRoot(JavaProjectTests.java:426)
at org.eclipse.jdt.core.tests.model.SuiteOfTestCases$Suite.runTest(SuiteOfTestCases.java:104)
at org.eclipse.jdt.core.tests.model.SuiteOfTestCases$Suite.superRun(SuiteOfTestCases.java:88)
at org.eclipse.jdt.core.tests.model.SuiteOfTestCases$1.protect(SuiteOfTestCases.java:76)
at org.eclipse.jdt.core.tests.model.SuiteOfTestCases$Suite.run(SuiteOfTestCases.java:85)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:657)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:310)
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:109)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:80)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:372)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:226)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
at org.eclipse.core.launcher.Main.main(Main.java:34)
Comment 1 Dani Megert CLA 2013-12-05 03:46:13 EST
Looks like 'JavaProjectTests' is unstable in general. See also bug 409466  and bug 403414.

It looks like this test depends on the order of the test methods. If you compare where it fails against a good run, you see different order, e.g. in the case where it fails, testAddZIPArchive* is called *after* the failed test.

==> In your workspace run the 'JavaProjectTests' test methods like in the failing case. I suspect you get the same failure.

If that's the case use org.eclipse.test.OrderedTestSuite to fix the problem.
Comment 2 shankha banerjee CLA 2013-12-05 05:47:18 EST
The comment 1 is correct about the order. I had two test cases
testAddNonJavaResourcePackageFragmentRoot
testAddZIPArchive1

as part of test suite.

If the test case testAddNonJavaResourcePackageFragmentRoot runs before testAddZIPArchive1 the test fails.

If the order is reversed both the tests succeed.

The failure stack trace looks different from the reported stack trace in comment 0.

The failure stack trace:

Java Model Exception: Java Model Status [JavaProjectTests does not exist]
	at org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:508)
	at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:246)
	at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:521)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:258)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:244)
	at org.eclipse.jdt.internal.core.JavaElement.getChildren(JavaElement.java:199)
	at org.eclipse.jdt.internal.core.JavaProject.getPackageFragmentRoots(JavaProject.java:1849)
	at org.eclipse.jdt.core.tests.model.AbstractJavaModelTests.getPackageFragmentRoot(AbstractJavaModelTests.java:2103)
	at org.eclipse.jdt.core.tests.model.JavaProjectTests.testAddNonJavaResourcePackageFragmentRoot(JavaProjectTests.java:411)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at junit.framework.TestCase.runTest(TestCase.java:176)
	at junit.framework.TestCase.runBare(TestCase.java:141)
	at junit.framework.TestResult$1.protect(TestResult.java:122)
	at junit.framework.TestResult.runProtected(TestResult.java:142)
	at junit.framework.TestResult.run(TestResult.java:125)
	at junit.framework.TestCase.run(TestCase.java:129)
	at junit.framework.TestSuite.runTest(TestSuite.java:255)
	at junit.framework.TestSuite.run(TestSuite.java:250)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:131)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62)
	at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:23)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	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:354)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Comment 3 Jay Arthanareeswaran CLA 2013-12-11 10:50:33 EST
Ran out of time, moving to M5.
Comment 4 shankha banerjee CLA 2014-01-01 02:04:25 EST
Please see Bug 424786 and Bug 409466.
Comment 5 shankha banerjee CLA 2014-03-03 07:50:08 EST
Moving to 4.4. M7.
Comment 6 shankha banerjee CLA 2014-03-05 04:11:05 EST
The tests suite does not fail  even if testAddNonJavaResourcePackageFragmentRoot executes before  testAddZIPArchive1.

The file JavaProjectTests.java hasn't changed in the last 10 months.
Comment 7 shankha banerjee CLA 2014-04-18 20:29:57 EDT
Created attachment 242136 [details]
Patch

The patch sorts the tests in alphabetical order and then executes them.
This is done so that following order is maintained.
testAddNonJavaResourcePackageFragmentRoot
testAddZIPArchive*

Please see: Comment 1 and Comment 2.

I have used the API: buildModelTestSuite instead of using org.eclipse.test.OrderedTestSuite as it leads to minimal changes
and I do not see a way to use it with buildModelTestSuite.

Thanks
Comment 8 Jay Arthanareeswaran CLA 2014-04-21 02:17:28 EDT
Thanks Shankha, I have released the patch in master:

http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=64774f020d7005b54827ff53032895aaf4555d81

This and the fact that the failure hasn't occurred during the last two milestones hopefully means this is buried forever.
Comment 9 Sasikanth Bharadwaj CLA 2014-04-29 07:15:18 EDT
Verified for 4.4 M7 using I20140428-2000 build
Comment 10 Dani Megert CLA 2014-05-13 04:29:27 EDT
(In reply to Jayaprakash Arthanareeswaran from comment #8)
> Thanks Shankha, I have released the patch in master:
> 
> http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/
> ?id=64774f020d7005b54827ff53032895aaf4555d81
> 
> This and the fact that the failure hasn't occurred during the last two
> milestones hopefully means this is buried forever.

Nope :-(

http://download.eclipse.org/eclipse/downloads/drops4/I20140512-2000/testresults/html/org.eclipse.jdt.core.tests.model_win32.win32.x86_7.0.html
Comment 11 Jay Arthanareeswaran CLA 2014-05-14 01:50:07 EDT
(In reply to Jayaprakash Arthanareeswaran from comment #8)
> Thanks Shankha, I have released the patch in master:
> 
> http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/
> ?id=64774f020d7005b54827ff53032895aaf4555d81
> 
> This and the fact that the failure hasn't occurred during the last two
> milestones hopefully means this is buried forever.

The patch doesn't seem to have any effect on the order in the official build/test environment!
Comment 12 Jay Arthanareeswaran CLA 2014-05-14 02:25:34 EDT
(In reply to Jayaprakash Arthanareeswaran from comment #11)
> The patch doesn't seem to have any effect on the order in the official
> build/test environment!

Please ignore this. In fact, the order doesn't seem to have any impact on the test result/failure.
Comment 13 Jay Arthanareeswaran CLA 2014-05-16 03:31:12 EDT
Shankha, in the interest of having clean results throughout the remaining Luna cycles, I think we should disable the concerned tests and take it up during 4.5
Comment 14 shankha banerjee CLA 2014-05-16 04:24:45 EDT
Created attachment 243159 [details]
Patch

The test has been disabled. Will continue investigate the reason for the failure.
Comment 15 Jay Arthanareeswaran CLA 2014-05-20 10:50:17 EDT
We don't have any fix yet, so the test has been disabled for now. But keeping the bug with 4.5 target so we don't loose sight of this.
Comment 16 Eclipse Genie CLA 2015-10-26 05:17:21 EDT
New Gerrit change created: https://git.eclipse.org/r/58901
Comment 17 Jay Arthanareeswaran CLA 2015-10-26 07:51:59 EDT
I have enabled the tests back with a fix here:

http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=15c0d9ce2c57a5a820b317d31ba95f4dca3c8294

The tests pass locally, of course, but needs to be seen how they do in the build environment.
Comment 18 Jay Arthanareeswaran CLA 2015-10-26 07:55:20 EDT
(In reply to Jay Arthanareeswaran from comment #17)
> I have enabled the tests back with a fix here:
> 
> http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/
> ?id=15c0d9ce2c57a5a820b317d31ba95f4dca3c8294

This also covers bug 409466 and bug 403414.
Comment 19 Jay Arthanareeswaran CLA 2015-10-29 01:25:18 EDT
The last few builds have been successful with the fix. Will keep it around during M4 before closing this, though.
Comment 20 Jay Arthanareeswaran CLA 2015-10-29 01:26:49 EDT
*** Bug 409466 has been marked as a duplicate of this bug. ***
Comment 21 Jay Arthanareeswaran CLA 2015-10-29 01:28:20 EDT
*** Bug 403414 has been marked as a duplicate of this bug. ***
Comment 22 Jay Arthanareeswaran CLA 2015-11-11 23:48:49 EST
The tests have now been enabled and released with fix. The fix is one or more of the following depending on cases:

1. Waiting for manual refresh and auto build before checking for build results.
2. Removing projects before end of current test case, to avoid dependency.
3. Keeping the order constant (use order of declaration of tests in CU)
4. Some other clean-ups.

*** This bug has been marked as a duplicate of bug 464369 ***
Comment 23 Manoj N Palat CLA 2015-12-08 08:29:31 EST
Verified for Eclipse Neon Version: Neon 4.6M4 Build id: I20151207-0800