Community
Participate
Working Groups
The following test is failing on nightly builds on Mac: testRestoreRevealAfterRevealCancel2 Test failed: expected:<org.eclipse.jface.viewers.TreePath@c1a7> but was:<org.eclipse.jface.viewers.TreePath@32> fListener = Viewer Update Listener fLabelUpdatesComplete = false fLabelUpdatesRunning = 9 fLabelUpdatesRunning = [ILabelUpdate: 2.2, ILabelUpdate: 2, ILabelUpdate: 1, ILabelUpdate: 2.1, ILabelUpdate: 2.3, ILabelUpdate: 2.1, ILabelUpdate: 3, ILabelUpdate: 2, ILabelUpdate: 3] fLabelUpdatesCompleted = [] fLabelUpdates = (EMPTY) fViewerUpdatesComplete = true fViewerUpdatesRunning = 0 fHasChildrenUpdatesRunning = [] fHasChildrenUpdatesCompleted = [IHasChildrenUpdate: 2.2, IHasChildrenUpdate: 3, IHasChildrenUpdate: 2.1, IHasChildrenUpdate: 2.3, IHasChildrenUpdate: 1, IHasChildrenUpdate: 2, IHasChildrenUpdate: 3] fHasChildrenUpdates = (EMPTY) fChildCountUpdatesRunning = [] fChildCountUpdatesCompleted = [IChildrenCountUpdate: 3, IChildrenCountUpdate: 2, IChildrenCountUpdate: 3, IChildrenCountUpdate: 3] fChildCountUpdates = (EMPTY) fChildrenUpdatesRunning = [] fChildrenUpdatesCompleted = [IChildrenUpdate: root {2->3}, IChildrenUpdate: 2 {0->3}, IChildrenUpdate: root {0->1}] fChildrenUpdates = (EMPTY) fModelChangedComplete = true fStateRestoreComplete = true fProxyModels = [] fStateUpdates = (EMPTY) fTimeoutInterval = 60000 org.eclipse.core.commands.ExecutionException: Test failed: expected:<org.eclipse.jface.viewers.TreePath@c1a7> but was:<org.eclipse.jface.viewers.TreePath@32> fListener = Viewer Update Listener fLabelUpdatesComplete = false fLabelUpdatesRunning = 9 fLabelUpdatesRunning = [ILabelUpdate: 2.2, ILabelUpdate: 2, ILabelUpdate: 1, ILabelUpdate: 2.1, ILabelUpdate: 2.3, ILabelUpdate: 2.1, ILabelUpdate: 3, ILabelUpdate: 2, ILabelUpdate: 3] fLabelUpdatesCompleted = [] fLabelUpdates = (EMPTY) fViewerUpdatesComplete = true fViewerUpdatesRunning = 0 fHasChildrenUpdatesRunning = [] fHasChildrenUpdatesCompleted = [IHasChildrenUpdate: 2.2, IHasChildrenUpdate: 3, IHasChildrenUpdate: 2.1, IHasChildrenUpdate: 2.3, IHasChildrenUpdate: 1, IHasChildrenUpdate: 2, IHasChildrenUpdate: 3] fHasChildrenUpdates = (EMPTY) fChildCountUpdatesRunning = [] fChildCountUpdatesCompleted = [IChildrenCountUpdate: 3, IChildrenCountUpdate: 2, IChildrenCountUpdate: 3, IChildrenCountUpdate: 3] fChildCountUpdates = (EMPTY) fChildrenUpdatesRunning = [] fChildrenUpdatesCompleted = [IChildrenUpdate: root {2->3}, IChildrenUpdate: 2 {0->3}, IChildrenUpdate: root {0->1}] fChildrenUpdates = (EMPTY) fModelChangedComplete = true fStateRestoreComplete = true fProxyModels = [] fStateUpdates = (EMPTY) fTimeoutInterval = 60000 at org.eclipe.debug.tests.viewer.model.JFaceViewerTopIndexTests.runTest(JFaceViewerTopIndexTests.java:77) at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:377) at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:210) 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:134) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3740) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3431) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) 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:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:621) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:576) at org.eclipse.equinox.launcher.Main.run(Main.java:1409) at org.eclipse.equinox.launcher.Main.main(Main.java:1385) at org.eclipse.core.launcher.Main.main(Main.java:34) Caused by: junit.framework.AssertionFailedError: expected:<org.eclipse.jface.viewers.TreePath@c1a7> but was:<org.eclipse.jface.viewers.TreePath@32> at org.eclipe.debug.tests.viewer.model.JFaceViewerTopIndexTests.testRestoreRevealAfterRevealCancel2(JFaceViewerTopIndexTests.java:446) at org.eclipe.debug.tests.viewer.model.JFaceViewerTopIndexTests.runTest(JFaceViewerTopIndexTests.java:75)
I can reproduce the problem running the test suite on Mac.
Created attachment 180700 [details] Possible fix. One optimistic scenario is that the state is not restored sufficiently before the new reveal delta is processed. In that case subsequent restoring of expanded states may shift the top index, much like the original bug we were trying to fix. This patch extends the number of levels that need to be restored (before the test proceeds to apply the overriding reveal delta). Darin, are you able to try it out on your Mac?
With the patch applied, I get the following failure: org.eclipse.core.commands.ExecutionException: Test failed: expected:<TreePath:[2, 2.1]> but was:<TreePath:[1]> fListener = Viewer Update Listener fLabelUpdatesComplete = true fLabelUpdatesRunning = 5 fLabelUpdatesRunning = [ILabelUpdate: 2.3, ILabelUpdate: 2.2, ILabelUpdate: 2.1, ILabelUpdate: 3, ILabelUpdate: 1] fLabelUpdatesCompleted = [ILabelUpdate: 3, ILabelUpdate: 2, ILabelUpdate: 2, ILabelUpdate: 2.1] fLabelUpdates = (EMPTY) fViewerUpdatesComplete = true fViewerUpdatesRunning = 0 fHasChildrenUpdatesRunning = [] fHasChildrenUpdatesCompleted = [IHasChildrenUpdate: 3, IHasChildrenUpdate: 2, IHasChildrenUpdate: 1, IHasChildrenUpdate: 2.2, IHasChildrenUpdate: 2.1, IHasChildrenUpdate: 3, IHasChildrenUpdate: 2.3] fHasChildrenUpdates = (EMPTY) fChildCountUpdatesRunning = [] fChildCountUpdatesCompleted = [IChildrenCountUpdate: 2, IChildrenCountUpdate: 3, IChildrenCountUpdate: 3, IChildrenCountUpdate: 3] fChildCountUpdates = (EMPTY) fChildrenUpdatesRunning = [] fChildrenUpdatesCompleted = [IChildrenUpdate: root {0->1}, IChildrenUpdate: 2 {0->3}, IChildrenUpdate: root {2->3}] fChildrenUpdates = (EMPTY) fModelChangedComplete = true fStateRestoreComplete = true fProxyModels = [] fStateUpdates = (EMPTY) fTimeoutInterval = 60000 at org.eclipe.debug.tests.viewer.model.JFaceViewerTopIndexTests.runTest(JFaceViewerTopIndexTests.java:77) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) 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.UITestApplication$1.run(UITestApplication.java:116) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3740) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3431) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) at org.eclipse.pde.internal.junit.runtime.UITestApplication.start(UITestApplication.java:47) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) 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:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:592) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:621) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:576) at org.eclipse.equinox.launcher.Main.run(Main.java:1409) at org.eclipse.equinox.launcher.Main.main(Main.java:1385) Caused by: junit.framework.AssertionFailedError: expected:<TreePath:[2, 2.1]> but was:<TreePath:[1]> at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.failNotEquals(Assert.java:283) at junit.framework.Assert.assertEquals(Assert.java:64) at junit.framework.Assert.assertEquals(Assert.java:71) at org.eclipe.debug.tests.viewer.model.TreePathWrapper.assertEqual(TreePathWrapper.java:41) at org.eclipe.debug.tests.viewer.model.JFaceViewerTopIndexTests.testRestoreRevealAfterRevealCancel2(JFaceViewerTopIndexTests.java:444) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:592) at junit.framework.TestCase.runTest(TestCase.java:168) at org.eclipe.debug.tests.viewer.model.JFaceViewerTopIndexTests.runTest(JFaceViewerTopIndexTests.java:75) ... 42 more
Hmm... in case you didn't hear that it was me scratching my head ;-) Is there any chance you could run this test with delta, content, and state tracing enabled?
Created attachment 180772 [details] trace file
Created attachment 180787 [details] Better fix attempt. Based on the trace, I what seems to be happening is the reveal delta is being applied before the expanded state of related is restored. So in effect the reveal has no effect (maybe on other platforms the reveal causes an expand also). I also found another minor issue from the log: the notify state restored was being called too early. This patch addresses that problem too. Darin, please give it a try.
Unfortunately, still red (fails). Here's the test stack trace (might be the same as before). org.eclipse.core.commands.ExecutionException: Test failed: expected:<TreePath:[2, 2.1]> but was:<TreePath:[1]> fListener = Viewer Update Listener fLabelUpdatesComplete = true fLabelUpdatesRunning = 5 fLabelUpdatesRunning = [ILabelUpdate: 1, ILabelUpdate: 3, ILabelUpdate: 2.1, ILabelUpdate: 2.3, ILabelUpdate: 2.2] fLabelUpdatesCompleted = [ILabelUpdate: 2, ILabelUpdate: 2.1, ILabelUpdate: 3, ILabelUpdate: 2] fLabelUpdates = (EMPTY) fViewerUpdatesComplete = true fViewerUpdatesRunning = 0 fHasChildrenUpdatesRunning = [] fHasChildrenUpdatesCompleted = [IHasChildrenUpdate: 3, IHasChildrenUpdate: 2.1, IHasChildrenUpdate: 2.3, IHasChildrenUpdate: 3, IHasChildrenUpdate: 1, IHasChildrenUpdate: 2, IHasChildrenUpdate: 2.2] fHasChildrenUpdates = (EMPTY) fChildCountUpdatesRunning = [] fChildCountUpdatesCompleted = [IChildrenCountUpdate: 2, IChildrenCountUpdate: 3, IChildrenCountUpdate: 3] fChildCountUpdates = (EMPTY) fChildrenUpdatesRunning = [] fChildrenUpdatesCompleted = [IChildrenUpdate: root {0->1}, IChildrenUpdate: root {2->3}, IChildrenUpdate: 2 {0->3}] fChildrenUpdates = (EMPTY) fModelChangedComplete = true fStateRestoreComplete = true fProxyModels = [] fStateUpdates = (EMPTY) fTimeoutInterval = 60000 at org.eclipe.debug.tests.viewer.model.JFaceViewerTopIndexTests.runTest(JFaceViewerTopIndexTests.java:77) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) 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.UITestApplication$1.run(UITestApplication.java:116) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3740) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3431) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) at org.eclipse.pde.internal.junit.runtime.UITestApplication.start(UITestApplication.java:47) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) 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:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:592) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:621) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:576) at org.eclipse.equinox.launcher.Main.run(Main.java:1409) at org.eclipse.equinox.launcher.Main.main(Main.java:1385) Caused by: junit.framework.AssertionFailedError: expected:<TreePath:[2, 2.1]> but was:<TreePath:[1]> at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.failNotEquals(Assert.java:283) at junit.framework.Assert.assertEquals(Assert.java:64) at junit.framework.Assert.assertEquals(Assert.java:71) at org.eclipe.debug.tests.viewer.model.TreePathWrapper.assertEqual(TreePathWrapper.java:41) at org.eclipe.debug.tests.viewer.model.JFaceViewerTopIndexTests.testRestoreRevealAfterRevealCancel2(JFaceViewerTopIndexTests.java:451) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:592) at junit.framework.TestCase.runTest(TestCase.java:168) at org.eclipe.debug.tests.viewer.model.JFaceViewerTopIndexTests.runTest(JFaceViewerTopIndexTests.java:75) ... 38 more
Created attachment 180788 [details] subsequent trace file for debug options
Created attachment 180790 [details] Another fix attempt. Sorry about that, I missed an important detail last time... it's really annoying not to be able to reproduce the bug myself.
(np... I feel like one of those old computer operators...) Next trace: org.eclipse.core.commands.ExecutionException: Test failed: expected:<TreePath:[2, 2.1]> but was:<TreePath:[1]> fListener = Viewer Update Listener fLabelUpdatesComplete = true fLabelUpdatesRunning = 5 fLabelUpdatesRunning = [ILabelUpdate: 2.2, ILabelUpdate: 3, ILabelUpdate: 1, ILabelUpdate: 2.3, ILabelUpdate: 2.1] fLabelUpdatesCompleted = [ILabelUpdate: 3, ILabelUpdate: 2, ILabelUpdate: 2, ILabelUpdate: 2, ILabelUpdate: 2.1, ILabelUpdate: 2.1] fLabelUpdates = (EMPTY) fViewerUpdatesComplete = true fViewerUpdatesRunning = 0 fHasChildrenUpdatesRunning = [] fHasChildrenUpdatesCompleted = [IHasChildrenUpdate: 3, IHasChildrenUpdate: 2.1, IHasChildrenUpdate: 2.2, IHasChildrenUpdate: 2.3, IHasChildrenUpdate: 2, IHasChildrenUpdate: 3, IHasChildrenUpdate: 1] fHasChildrenUpdates = (EMPTY) fChildCountUpdatesRunning = [] fChildCountUpdatesCompleted = [IChildrenCountUpdate: 3, IChildrenCountUpdate: 2, IChildrenCountUpdate: 3, IChildrenCountUpdate: 3] fChildCountUpdates = (EMPTY) fChildrenUpdatesRunning = [] fChildrenUpdatesCompleted = [IChildrenUpdate: root {2->3}, IChildrenUpdate: root {0->1}, IChildrenUpdate: 2 {0->3}] fChildrenUpdates = (EMPTY) fModelChangedComplete = true fStateRestoreComplete = false fProxyModels = [] fStateUpdates = (EMPTY) fTimeoutInterval = 60000 at org.eclipe.debug.tests.viewer.model.JFaceViewerTopIndexTests.runTest(JFaceViewerTopIndexTests.java:78) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) 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.UITestApplication$1.run(UITestApplication.java:116) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3740) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3431) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) at org.eclipse.pde.internal.junit.runtime.UITestApplication.start(UITestApplication.java:47) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) 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:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:592) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:621) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:576) at org.eclipse.equinox.launcher.Main.run(Main.java:1409) at org.eclipse.equinox.launcher.Main.main(Main.java:1385) Caused by: junit.framework.AssertionFailedError: expected:<TreePath:[2, 2.1]> but was:<TreePath:[1]> at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.failNotEquals(Assert.java:283) at junit.framework.Assert.assertEquals(Assert.java:64) at junit.framework.Assert.assertEquals(Assert.java:71) at org.eclipe.debug.tests.viewer.model.TreePathWrapper.assertEqual(TreePathWrapper.java:41) at org.eclipe.debug.tests.viewer.model.JFaceViewerTopIndexTests.testRestoreRevealAfterRevealCancel2(JFaceViewerTopIndexTests.java:453) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:592) at junit.framework.TestCase.runTest(TestCase.java:168) at org.eclipe.debug.tests.viewer.model.JFaceViewerTopIndexTests.runTest(JFaceViewerTopIndexTests.java:76) ... 38 more
Created attachment 180792 [details] associated trace file
Created attachment 180797 [details] Fix attempt #4. One more try, though I'm basically out of ideas. From the trace it appears that the reveal delta is processed properly (along with element expand) so the view should show the "2.1" as the top element. So if you could confirm that this is happening through the debugger that would be useful. If the reveal is called and the top element is not shown, then maybe it's another manifestation of bug 116105? Another possibility is that the reveal is processed but the expansions that happen in the view following that are causing the view to scroll to the top somehow. The change in this patch attempts to further prevent that scenario.
Created attachment 180806 [details] screen shot When the test fails, "2" is actually on top, but the tree thinks the top item is #1. i.e. the following code: TreeItem topItem = ((Tree)getControl()).getTopItem();
Created attachment 180811 [details] Fix attempt #5. Maybe we just need to wait a little longer for the view to settle after calling reveal. This patch may be enough. Or we could put in a 1 sec delay as a workaround for mac: // 1-sec delay to workaournd a reveal problem on mac // Bug 327557 long delay = System.currentTimeMillis() + 1000; while(delay > System.currentTimeMillis()) { if (!fDisplay.readAndDispatch()) Thread.yield(); }
With the patch, I get a different sort of failure (below). And, if I add a 1 second delay I get the original failure (it is rooted at item #2, although the tree viewer thinks its rooted at #1). org.eclipse.core.commands.ExecutionException: Test failed: Top item should not be null! fListener = Viewer Update Listener fLabelUpdatesComplete = true fLabelUpdatesRunning = 0 fLabelUpdatesRunning = [] fLabelUpdatesCompleted = [ILabelUpdate: 2.1, ILabelUpdate: 2, ILabelUpdate: 2.1, ILabelUpdate: 2, ILabelUpdate: 3, ILabelUpdate: 2] fLabelUpdates = (EMPTY) fViewerUpdatesComplete = false fViewerUpdatesRunning = 2 fHasChildrenUpdatesRunning = [IHasChildrenUpdate: 3, IHasChildrenUpdate: 2] fHasChildrenUpdatesCompleted = [] fHasChildrenUpdates = (EMPTY) fChildCountUpdatesRunning = [] fChildCountUpdatesCompleted = [IChildrenCountUpdate: root] fChildCountUpdates = (EMPTY) fChildrenUpdatesRunning = [] fChildrenUpdatesCompleted = [IChildrenUpdate: root {1->3}] fChildrenUpdates = (EMPTY) fModelChangedComplete = true fStateRestoreComplete = false fProxyModels = [] fStateUpdates = (EMPTY) fTimeoutInterval = 60000 at org.eclipe.debug.tests.viewer.model.JFaceViewerTopIndexTests.runTest(JFaceViewerTopIndexTests.java:78) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) 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.UITestApplication$1.run(UITestApplication.java:116) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3740) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3431) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) at org.eclipse.pde.internal.junit.runtime.UITestApplication.start(UITestApplication.java:47) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) 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:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:592) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:621) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:576) at org.eclipse.equinox.launcher.Main.run(Main.java:1409) at org.eclipse.equinox.launcher.Main.main(Main.java:1385) Caused by: junit.framework.AssertionFailedError: Top item should not be null! at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.assertTrue(Assert.java:20) at junit.framework.Assert.assertNotNull(Assert.java:214) at org.eclipe.debug.tests.viewer.model.JFaceViewerTopIndexTests.testRestoreRevealAfterRevealCancel2(JFaceViewerTopIndexTests.java:456) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:592) at junit.framework.TestCase.runTest(TestCase.java:168) at org.eclipe.debug.tests.viewer.model.JFaceViewerTopIndexTests.runTest(JFaceViewerTopIndexTests.java:76) ... 38 more
It's starting to look like a viewer issue on Mac (perhaps SWT). For now I've disabled the test on Mac until we have more time to make an SWT snippet. if (Platform.getOS().equals(Platform.OS_MACOSX)) { // skip this test on Mac - see bug 327557 return; }
I committed the fix attempt #5 because it's still an improvement over the existing test. It may prevent intermittent exceptions that could show up on tests over time.
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. If you have further information on the current state of the bug, please add it. 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. If the bug is still relevant, please remove the stalebug whiteboard tag.