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

Bug 359079

Summary: BindingPersistenceTest's testBindingTransform win32 x86 test failed on N20110926-2000
Product: [Eclipse Project] Platform Reporter: Remy Suen <remy.suen>
Component: UIAssignee: Remy Suen <remy.suen>
Status: VERIFIED FIXED QA Contact: Remy Suen <remy.suen>
Severity: normal    
Priority: P3 CC: daniel_megert, david_williams
Version: 3.8   
Target Milestone: 3.8 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Remy Suen CLA 2011-09-27 10:32:47 EDT
junit.framework.AssertionFailedError: expected:<1> but was:<0>
at org.eclipse.ui.tests.keys.BindingPersistenceTest.testBindingTransform(BindingPersistenceTest.java:210)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:501)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:259)
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:135)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4140)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
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:344)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:624)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:579)
at org.eclipse.equinox.launcher.Main.run(Main.java:1431)
at org.eclipse.equinox.launcher.Main.main(Main.java:1407)
at org.eclipse.core.launcher.Main.main(Main.java:34)
Comment 1 Dani Megert CLA 2011-09-28 04:10:00 EDT
It also failed in I20110927-0800.
Comment 2 Remy Suen CLA 2011-09-28 07:50:34 EDT
Also on N20110927-2000.

The problem does not appear to occur if only BindingPersistenceTest is run.
Comment 3 Remy Suen CLA 2011-09-28 08:25:44 EDT
I went back to c5dda97ca5c5e9227bb026c9fb5682ec1de4b88c from the end of August and can still reproduce the problem when I run the whole test suite. Not quite sure what's going on yet.
http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?h=R3_development&id=c5dda97ca5c5e9227bb026c9fb5682ec1de4b88c
Comment 4 Remy Suen CLA 2011-09-28 10:47:05 EDT
When it fails in the debugger, it seems like the binding manager's map of active bindings is an empty map.
Comment 5 Remy Suen CLA 2011-09-29 12:56:07 EDT
Tried asking the binding service to reread the registry in an attempt to repopulate the map but it didn't seem to do it.
Comment 6 Remy Suen CLA 2011-09-30 14:43:09 EDT
Failed even when I checked out the R3_7 tag from Git and ran the tests with 3.7.0 on Windows XP. -_-
Comment 7 Dani Megert CLA 2011-10-03 09:34:50 EDT
(In reply to comment #6)
> Failed even when I checked out the R3_7 tag from Git and ran the tests with
> 3.7.0 on Windows XP. -_-

The test fails constantly since about a week and since it also fails with 3.7 I suspect that recent changes in another bundle are causing this. Other (less) possible issue: you use a different JRE.
Comment 8 Remy Suen CLA 2011-10-03 12:17:15 EDT
(In reply to comment #7)
> The test fails constantly since about a week and since it also fails with 3.7 I
> suspect that recent changes in another bundle are causing this. Other (less)
> possible issue: you use a different JRE.

I made a fresh clone and unzipped a new 3.7.0. Tried running the tests a few times with Java 7 and Java 6 and it passed once in like eight tries (the pass was on Java 6).

Dani, how do you suggest I proceed?
Comment 9 Dani Megert CLA 2011-10-03 12:24:46 EDT
Looks like now it fails more consistently. I guess the only thing is to really debug the issue.
Comment 10 Remy Suen CLA 2011-10-03 12:28:30 EDT
Too bad we don't have 3.7.x builds going yet as it would be helpful to know if the test fails for our maintenance builds or not.
Comment 11 Dani Megert CLA 2011-10-03 12:32:08 EDT
You said that it only happens when when running all tests. I would look for tests that got added in the past one or two weeks. Maybe they cause this by a side effect.
Comment 12 Remy Suen CLA 2011-10-04 08:42:10 EDT
(In reply to comment #11)
> You said that it only happens when when running all tests. I would look for
> tests that got added in the past one or two weeks. Maybe they cause this by a
> side effect.

Some new tests were added but they were for the JFace and databinding test suite.

Based on some print statements and repeated runs of the test suite, it seems that when the test passes the binding manager ends up recomputing its bindings a couple of times when BindingPersistenceTest's testAutoLoad test is run. When the test fails, no binding recomputation is being performed.
Comment 13 Remy Suen CLA 2011-10-04 14:15:58 EDT
Activating some contexts seems to be ensuring that the bindings are in the manager and retrievable. Worked for a couple of runs on 3.7.0. Trying now on my regular 3.x workspace against 3.8.
Comment 14 Remy Suen CLA 2011-10-04 16:18:44 EDT
(In reply to comment #13)
> Activating some contexts seems to be ensuring that the bindings are in the
> manager and retrievable. Worked for a couple of runs on 3.7.0. Trying now on my
> regular 3.x workspace against 3.8.

I've pushed the change to R3_development. Let's see what happens tonight...
http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?h=R3_development&id=d2f8ee873eaa2754b7ebbd90c389ddd1a0d3ee1d
Comment 15 Dani Megert CLA 2011-10-05 11:37:39 EDT
Ha! It no longer failed in N20111004-2000 but on Linux we now got the following test failure (no idea whether this is related to this fix).

Adaptable test 1 has failed for object org.eclipse.ui.tests.menus.ObjectContributionClasses$C@b725bd

junit.framework.AssertionFailedError: Adaptable test 1 has failed for object org.eclipse.ui.tests.menus.ObjectContributionClasses$C@b725bd
at org.eclipse.ui.tests.decorators.DecoratorAdaptableTests.assertDecorated(DecoratorAdaptableTests.java:56)
at org.eclipse.ui.tests.decorators.DecoratorAdaptableTests.testAdaptables(DecoratorAdaptableTests.java:84)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:501)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:259)
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:135)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3563)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3212)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
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:352)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:624)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:579)
at org.eclipse.equinox.launcher.Main.run(Main.java:1431)
at org.eclipse.equinox.launcher.Main.main(Main.java:1407)
at org.eclipse.core.launcher.Main.main(Main.java:34)
Comment 16 Remy Suen CLA 2011-10-05 11:44:09 EDT
(In reply to comment #15)
> Ha! It no longer failed in N20111004-2000 but on Linux we now got the following
> test failure (no idea whether this is related to this fix).
> 
> Adaptable test 1 has failed for object
> org.eclipse.ui.tests.menus.ObjectContributionClasses$C@b725bd
> 
> junit.framework.AssertionFailedError: Adaptable test 1 has failed for object
> org.eclipse.ui.tests.menus.ObjectContributionClasses$C@b725bd
> at
> org.eclipse.ui.tests.decorators.DecoratorAdaptableTests.assertDecorated(DecoratorAdaptableTests.java:56)
> at
> org.eclipse.ui.tests.decorators.DecoratorAdaptableTests.testAdaptables(DecoratorAdaptableTests.java:84)

Not likely because the DecoratorsTestSuite is added to the test suite before the KeysTestSuite. So assuming JUnit isn't broken and is running them sequentially then changes in a later test suite shouldn't affect something before.
Comment 17 Remy Suen CLA 2011-10-26 08:47:43 EDT
This test hasn't failed in a while and is looking good in this week's I builds. Marking as VERIFIED.
Comment 18 Dani Megert CLA 2011-11-17 10:10:18 EST
The fix did not make it into master.
Cherry-picked now: 43e6123882e908156ced6daa2edbc52197c56f73