Bug 366608 - [KeyBindings] [Compatibility] Failures in KeysTestSuite
Summary: [KeyBindings] [Compatibility] Failures in KeysTestSuite
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.5 RC1   Edit
Assignee: Andrey Loskutov CLA
QA Contact:
URL:
Whiteboard:
Keywords: test
Depends on:
Blocks: 366451 381873
  Show dependency tree
 
Reported: 2011-12-13 14:18 EST by Paul Webster CLA
Modified: 2015-05-12 05:10 EDT (History)
5 users (show)

See Also:


Attachments
Diff of the 2 different test directories (26.51 KB, patch)
2014-02-13 14:25 EST, Paul Webster CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Webster CLA 2011-12-13 14:18:23 EST
Test: 80/80 Errors: 0 Failures: 4
Comment 1 Paul Webster CLA 2011-12-13 14:20:52 EST
The failures seem related to the fact we don't remove the "lesser" binding on different platforms or at different levels, we just allow the "greater" binding to override it.

org.eclipse.ui.tests.keys.BindingPersistenceTest.testSinglePlatform()
org.eclipse.ui.tests.keys.BindingPersistenceTest.testBindingTransform()
org.eclipse.ui.tests.keys.BindingPersistenceTest.testModifierWithPlatform()
org.eclipse.ui.tests.keys.KeysPreferenceModelTest.testBasicConflicts()

PW
Comment 2 Paul Elder CLA 2014-02-12 14:22:09 EST
It turns out there are two KeysTestSuite instances:

* org.eclipse.ui.tests.keys.KeysTestSuite (plugin: org.eclipse.ui.tests)
* org.eclipse.e4.ui.keybinding.tests.KeysTestSuite (plugin: org.eclipse.e4.ui.keybindings.tests)

If I close either plug-in, and run the tests in the other, everything is green. Only with both plug-ins open do I get failures. It turns out the plug-in org.eclipse.e4.ui.keybindings.tests started out as a copy of the other - it redefines key bindings and commands already defined in org.eclipse.ui.tests. Removing those duplicate bindings allows both test suites to run while the other plug-in is open.

The question is, if I delete the duplicate bindings, then I need to introduce a dependency between these two plug-ins - which way should it be. OR, I can 'rename' the bindings in one of these plug-ins so that they don't overlap with the other, and then review/modify all the test cases that then fail.

Paul W: Any preference for what I should do?
Comment 3 Paul Elder CLA 2014-02-13 10:33:08 EST
(In reply to comment #2)
> Paul W: Any preference for what I should do?

Talked to Paul offline. We decided to go with removing the binding declarations for the e4 tests, and add a dependency to the legacy test plug-in (org.eclipse.ui.tests). Proposed fix pushed to Gerrit as:

https://git.eclipse.org/r/21949
Comment 4 Paul Webster CLA 2014-02-13 14:25:32 EST
Created attachment 239919 [details]
Diff of the 2 different test directories

This is a generic diff of the 2 separate directories.

If I'm reading it correctly, we could merge some extra tests from the e4 BindingPersistenceTest into the org.eclipse.ui.tests BindingPersistenceTest and then delete the e4 version completely.

Sorry I didn't realize just how close there were before.

PW
Comment 5 Paul Elder CLA 2014-02-14 11:12:25 EST
(In reply to comment #4)
> Created attachment 239919 [details]
> Diff of the 2 different test directories
> 
> This is a generic diff of the 2 separate directories.
> 
> If I'm reading it correctly, we could merge some extra tests from the e4
> BindingPersistenceTest into the org.eclipse.ui.tests BindingPersistenceTest and
> then delete the e4 version completely.
> 
> Sorry I didn't realize just how close there were before.
> 
> PW
I've abandoned the change mentioned in comment 3. Pushed a new change, that adds the 5 distinct JUnits from the e4 keybinding tests into org.eclipse.ui.tests, and deletes the org.eclipse.e4.ui.keybindings project:

https://git.eclipse.org/r/22018
Comment 7 Paul Webster CLA 2014-02-19 12:59:28 EST
Since I've added this back, we now get 6 failures on the mac: http://download.eclipse.org/eclipse/downloads/drops4/I20140218-0800/testresults/html/org.eclipse.ui.tests_macosx.cocoa.x86_5.0.html

Paul, could you please have a look?

PW
Comment 8 Paul Elder CLA 2014-02-19 15:18:40 EST
(In reply to Paul Webster from comment #7)
> Since I've added this back, we now get 6 failures on the mac:
> http://download.eclipse.org/eclipse/downloads/drops4/I20140218-0800/
> testresults/html/org.eclipse.ui.tests_macosx.cocoa.x86_5.0.html
> 
> Paul, could you please have a look?
> 

Looking right now. Some of the new tests have invalid assumptions about Mac key bindings. Preparing a patch right now.
Comment 9 Paul Elder CLA 2014-02-19 15:48:56 EST
(In reply to Paul Elder from comment #8)
> (In reply to Paul Webster from comment #7)
> > Since I've added this back, we now get 6 failures on the mac:
> > http://download.eclipse.org/eclipse/downloads/drops4/I20140218-0800/
> > testresults/html/org.eclipse.ui.tests_macosx.cocoa.x86_5.0.html
> > 
> > Paul, could you please have a look?
> > 
> 
> Looking right now. Some of the new tests have invalid assumptions about Mac
> key bindings. Preparing a patch right now.

Here's the fix. Tested on Mac and Windows. Paul W, can you test on Linux?

https://git.eclipse.org/r/22260
Comment 10 Paul Webster CLA 2014-02-20 13:58:44 EST
(In reply to Paul Elder from comment #9)
> 
> Here's the fix. Tested on Mac and Windows. Paul W, can you test on Linux?
> 
> https://git.eclipse.org/r/22260

Released this fix as http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=eee261ed514929a5321b7b3687478ba0dcb3b378

The tests run clean for me on Linux and there's a failure unrelated to keybindings on mac.

PW
Comment 11 Paul Webster CLA 2014-03-04 05:59:00 EST
The build says there are 6 test failures again, although they ran clean locally on the mac.  I'll test locally again: http://download.eclipse.org/eclipse/downloads/drops4/I20140303-2000/testresults/html/org.eclipse.ui.tests_macosx.cocoa.x86_5.0.html

PW
Comment 12 Markus Keller CLA 2014-03-04 14:42:32 EST
If you see these 2 failures, the reason is bug 429592 (but I don't know what made them fail in the last couple of test runs, but not in I20140303-2000):

- org.eclipse.ui.tests.keys.Bug43538Test.testCtrlSpace(Bug43538Test.java:63)
- org.eclipse.ui.tests.keys.Bug43610Test.testShiftAlt(Bug43610Test.java:62)
Comment 13 Paul Webster CLA 2014-03-04 15:10:34 EST
(In reply to Markus Keller from comment #12)
> If you see these 2 failures, the reason is bug 429592 (but I don't know what
> made them fail in the last couple of test runs, but not in I20140303-2000):
> 
> - org.eclipse.ui.tests.keys.Bug43538Test.testCtrlSpace(Bug43538Test.java:63)
> - org.eclipse.ui.tests.keys.Bug43610Test.testShiftAlt(Bug43610Test.java:62)

My local tests on a mac switch between all green, only those 2 failing, and 6 failing like in the last I-build test.
Comment 14 Markus Keller CLA 2014-03-05 09:34:37 EST
The two KeyDown tests are no-ops when the workbench window (of the running tests) doesn't have focus: In that case, SWT doesn't deliver the Display#post(...) events, and the tests don't detect that (-> green).

On the Mac, I see only these two fail (due to bug 429592).
Comment 15 Markus Keller CLA 2014-03-11 07:09:39 EDT
(In reply to Markus Keller from comment #12)
> - org.eclipse.ui.tests.keys.Bug43538Test.testCtrlSpace(Bug43538Test.java:63)
> - org.eclipse.ui.tests.keys.Bug43610Test.testShiftAlt(Bug43610Test.java:62)

Fixed with http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=c4d4b0663ab4533018de913045e0baa6d65360f4
Comment 16 Dani Megert CLA 2014-04-08 11:37:53 EDT
I'm setting the target back to M7. If can't spend time to fix them, then we should disable them on the Mac. In N20140406-2000 there were again 5 failures.
Comment 17 Paul Webster CLA 2014-04-24 16:58:49 EDT
I've disabled some of the tests as they aren't important now, but the transform test still needs to be investigated.

PW
Comment 18 Paul Webster CLA 2014-04-28 10:47:13 EDT
fixed.

PW
Comment 19 Paul Webster CLA 2014-04-29 08:50:49 EDT
testBindingTransform failed in the latest I build.

PW
Comment 20 Paul Webster CLA 2014-04-30 16:56:59 EDT
This still needs to be investigated but it's not a regression (the tests were added M6 but this test has been failing since Kepler).  Deferred.

I've disabled the test for now with http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=477b44770d995d87751fd7fbbff1f51406b72557

PW
Comment 21 Andrey Loskutov CLA 2015-05-05 15:32:45 EDT
Those 3 tests are failing right now on Linux in official build but do not fail if I run them locally:

BindingPersistenceTest.testAboutBindingEmacs
BindingPersistenceTest.testAboutBinding
BindingPersistenceTest.testAboutBindingIn3x

The failures are caused by two assertions: 
assertNotNull(bindingService.getPerfectMatch(KeySequence.getInstance("F12")))
 and 
assertNotNull(bindingService.getPerfectMatch(KeySequence.getInstance("ALT+R")))

Any idea?
Comment 22 Eclipse Genie CLA 2015-05-09 15:34:49 EDT
New Gerrit change created: https://git.eclipse.org/r/47567
Comment 24 Andrey Loskutov CLA 2015-05-09 16:07:24 EDT
(In reply to Eclipse Genie from comment #23)
> Gerrit change https://git.eclipse.org/r/47567 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/
> ?id=356175fe9ea00d59ffc307df1c2917f5c22f843f

Close VerifyDialog instances left open after the UIWizardsAuto and
DeprecatedUIWizardsAuto tests. Those opened dialogs affected somehow key
binding tests below.

BindingPersistenceTest.testAboutBinding - OK now
BindingPersistenceTest.testAboutBindingIn3x - OK now
BindingPersistenceTest.testAboutBindingEmacs - still failing

If one excludes either org.eclipse.ui.tests.dialogs.UIWizardsAuto or
org.eclipse.ui.tests.dialogs.DeprecatedUIWizardsAuto or both (included
in the UIAutomatedSuite) all tests pass. So there is still something in
those wizard tests which makes BindingPersistenceTest unhappy.

I've merged the commit withoit review since changes should not affect other tests (no extra failures), the changes are only in the test code and minimal.
Comment 25 Lars Vogel CLA 2015-05-11 05:35:56 EDT
(In reply to Andrey Loskutov from comment #24)
> I've merged the commit withoit review since changes should not affect other
> tests (no extra failures), the changes are only in the test code and minimal.

Working on test without review is fine, tests, examples and demos are not part of the endgame plan.
Comment 26 Andrey Loskutov CLA 2015-05-12 05:10:53 EDT
(In reply to Eclipse Genie from comment #23)
> Gerrit change https://git.eclipse.org/r/47567 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/
> ?id=356175fe9ea00d59ffc307df1c2917f5c22f843f

Seems to be fixed now in http://download.eclipse.org/eclipse/downloads/drops4/I20150511-2130/testResults.php