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

Bug 316830

Summary: Eclipse auto test: testSortMultipleCategory expected:<a[1]> but was:<a[3]> in solaris10 with jdk7-b96
Product: [Eclipse Project] Platform Reporter: Tao Zhang <taozhang816>
Component: User AssistanceAssignee: Chris Goldthorpe <cgold>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: cgold
Version: 3.6   
Target Milestone: 3.7 M6   
Hardware: Other   
OS: other   
Whiteboard:
Attachments:
Description Flags
Patch none

Description Tao Zhang CLA 2010-06-14 17:04:44 EDT
Build Identifier: 

The eclipse auto tests(3.4.2) in solaris-sparc10, it fails in jdk7-b96 due to expect a[1], but was a[3], see exceptions below:
testSortMultipleCategory
expected:<a[1]> but was:<a[3]>

junit.framework.ComparisonFailure: expected:<a[1]> but was:<a[3]>
at org.eclipse.ua.tests.help.other.ContextLinkSorter.testSortMultipleCategory(ContextLinkSorter.java:116)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:354)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:206)
at org.eclipse.test.UITestApplication$3.run(UITestApplication.java:195)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:133)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3378)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3036)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2384)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2348)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2200)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:495)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:490)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.test.UITestApplication.runApplication(UITestApplication.java:138)
at org.eclipse.test.UITestApplication.run(UITestApplication.java:60)
at org.eclipse.test.UITestApplication.start(UITestApplication.java:210)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
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:386)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
at org.eclipse.core.launcher.Main.main(Main.java:30)


Reproducible: Always

Steps to Reproduce:
1.See bugs https://bugs.eclipse.org/bugs/show_bug.cgi?id=316827
2.
3.
Comment 1 Prakash Rangaraj CLA 2010-07-29 04:52:42 EDT
Moving to UA
Comment 2 Chris Goldthorpe CLA 2011-01-20 18:36:09 EST
I believe that the reason why this test is failing is because the sort code from jdk7 is using a different algorithm and contexts which compare as equal end up in a non deterministic order. I will look into why the result of the comparing two different contexts is equality in some cases.
Comment 3 Chris Goldthorpe CLA 2011-02-15 13:50:42 EST
Are you using a Sun ( Oracle ) JRE?
Comment 4 Chris Goldthorpe CLA 2011-02-21 13:12:32 EST
Created attachment 189431 [details]
Patch

The algorithm was making too many assumptions about the sort - in particular it was assuming that compare() would be called on the elements in the order in which they appear in the array. The recoded algorithm only assumes that the sort is stable.
Comment 5 Chris Goldthorpe CLA 2011-02-21 13:13:34 EST
Patch committed to HEAD.