This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 432604 - [CommonNavigator] ui.tests.navigator: LabelProviderTest.testOverrideChain fails consistently
Summary: [CommonNavigator] ui.tests.navigator: LabelProviderTest.testOverrideChain fai...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.4 M7   Edit
Assignee: Paul Webster CLA
QA Contact: Wojciech Sudol CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-11 06:03 EDT by Dani Megert CLA
Modified: 2014-05-01 10:15 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2014-04-11 06:03:08 EDT
LabelProviderTest.testOverrideChain fails consistently on Windows 7 and Linux.

Wrong query order for text

junit.framework.AssertionFailedError: Wrong query order for text
at org.eclipse.ui.tests.navigator.LabelProviderTest.testOverrideChain(LabelProviderTest.java:233)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:657)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:310)
at org.eclipse.test.UITestApplication$2.run(UITestApplication.java:197)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1135)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1016)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:635)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:578)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
at org.eclipse.test.UITestApplication.runApplication(UITestApplication.java:140)
at org.eclipse.test.UITestApplication.run(UITestApplication.java:62)
at org.eclipse.test.UITestApplication.start(UITestApplication.java:212)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:379)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:233)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
at org.eclipse.core.launcher.Main.main(Main.java:34)
Comment 1 Paul Webster CLA 2014-04-21 10:39:34 EDT
This passes for me on linux with 1.7.0_51, but failes with 1.8.  I'll investigate further.

PW
Comment 2 Wojciech Sudol CLA 2014-04-25 12:23:11 EDT
In my environment (Windows 7 x64) it fails only with Java 8.
Comment 3 Paul Webster CLA 2014-04-25 13:04:59 EDT
(In reply to Wojciech Sudol from comment #2)
> In my environment (Windows 7 x64) it fails only with Java 8.

Correct, that's the same problem I have.  The question is why?

PW
Comment 4 Wojciech Sudol CLA 2014-04-25 16:36:35 EDT
The test fails with Java 8 because of changes in HashMap implementation. These changes affects the order of elements returned by NavigatorContentService.findPossibleLabelExtensions(Object).
However it is not clear if the 'new' order is incorrect. The javadoc comments are not precise enough. I will try to find more information about this functionality and determine expected result.
Comment 5 Dani Megert CLA 2014-04-26 04:17:28 EDT
(In reply to Wojciech Sudol from comment #4)
> The test fails with Java 8 because of changes in HashMap implementation.

In case the current order is correct, just use org.eclipse.test.OrderedTestSuite.
Comment 6 Paul Webster CLA 2014-04-30 11:27:33 EDT
Francis, I'm looking at this failure with java 8 and the question I had was, what order does overrides/@suppressedExtensionId guarantee?

I'm just guessing that the extensions are all sorted by priority (high to low) and then extensions get to go before their suppressed extensions, right?

PW
Comment 7 Paul Webster CLA 2014-04-30 11:46:45 EDT
OK, we have:
A - normal
B - normal - override: A
C - low - override: A
D - low - override: B
E - low - override: D
F - high - override: C
G - normal - override: C

If I sort them into buckets, I get:

high  : F
normal: A B G
low   : C D E

Now I assume that the overrides will  move the label providers before the extension being overridden.  But within a group there's no order, so there's a couple of ways that can be accomplished.

This seems valid to me: F G E D BC A

The test asks for FEDBGCA

PW
Comment 9 Francis Upton IV CLA 2014-04-30 17:08:56 EDT
Sorry Paul, I have forgotten most of that stuff, even though I'm still on the list. Maybe one day I can come back. What you have seems right though.
Comment 10 Paul Webster CLA 2014-04-30 17:45:18 EDT
(In reply to Francis Upton IV from comment #9)
> Sorry Paul, I have forgotten most of that stuff, even though I'm still on
> the list. Maybe one day I can come back. What you have seems right though.

Thanks for getting back to me :-)
PW