Bug 544675 - org.eclipse.ui.tests: TextHandlerTest.testEditableText fails on mac (disabled for now)
Summary: org.eclipse.ui.tests: TextHandlerTest.testEditableText fails on mac (disabled...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.11   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Kalyan Prasad Tatavarthi CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 559476
Blocks:
  Show dependency tree
 
Reported: 2019-02-21 10:16 EST by Kalyan Prasad Tatavarthi CLA
Modified: 2020-04-21 03:44 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kalyan Prasad Tatavarthi CLA 2019-02-21 10:16:32 EST
org.eclipse.ui.tests testEditableText is failing on mac 

with the below stack trace

N/A 

junit.framework.AssertionFailedError
at junit.framework.Assert.fail(Assert.java:55)
at junit.framework.Assert.assertTrue(Assert.java:22)
at junit.framework.Assert.assertFalse(Assert.java:39)
at junit.framework.Assert.assertFalse(Assert.java:47)
at junit.framework.TestCase.assertFalse(TestCase.java:219)
at org.eclipse.ui.tests.internal.TextHandlerTest.testEditableText(TextHandlerTest.java:48)
Comment 1 Kalyan Prasad Tatavarthi CLA 2019-02-21 10:18:29 EST
This test fails in the build I20190128-1800 and every I-build after that.
This test was not failing in the previous week's build I20190121-1415.
Comment 2 Andrey Loskutov CLA 2019-02-26 06:05:00 EST
Looks like a side effect of *enabling* tests via bug 485167. I believe I've seen similar comments for Mac tests that something isn't working on Mac without extra settings. I will try to find out where I saw this.
Comment 3 Eclipse Genie CLA 2019-02-26 06:39:15 EST
New Gerrit change created: https://git.eclipse.org/r/137612
Comment 4 Andrey Loskutov CLA 2019-02-26 06:42:59 EST
(In reply to Andrey Loskutov from comment #2)
> Looks like a side effect of *enabling* tests via bug 485167. I believe I've
> seen similar comments for Mac tests that something isn't working on Mac
> without extra settings. I will try to find out where I saw this.

This was about "On the Mac, checkboxes only take focus if "Full Keyboard Access" is enabled in the System Preferences." comment I saw in FindReplaceDialogTest. May be it is unrelated, but in the gerrit patch I've also added now an explicit focus() call on editable text.
Comment 6 Andrey Loskutov CLA 2019-02-27 00:59:47 EST
(In reply to Eclipse Genie from comment #5)
> Gerrit change https://git.eclipse.org/r/137612 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/
> ?id=6ee864993a7335fdb7563373f075c3e50b8983d5

The changed test still fails, and it looks for me that Clipboard.setContents is broken on Mac.

https://download.eclipse.org/eclipse/downloads/drops4/I20190226-1800/testresults/html/org.eclipse.ui.tests_ep411I-unit-mac64-java8_macosx.cocoa.x86_64_8.0.html

junit.framework.AssertionFailedError
at junit.framework.Assert.fail(Assert.java:55)
at junit.framework.Assert.assertTrue(Assert.java:22)
at junit.framework.Assert.assertFalse(Assert.java:39)
at junit.framework.Assert.assertFalse(Assert.java:47)
at junit.framework.TestCase.assertFalse(TestCase.java:219)
at org.eclipse.ui.tests.internal.TextHandlerTest.testEditableText(TextHandlerTest.java:59)
Comment 7 Paul Pazderski CLA 2020-01-22 09:11:32 EST
(In reply to Eclipse Genie from comment #5)
> Gerrit change https://git.eclipse.org/r/137612 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/
> ?id=6ee864993a7335fdb7563373f075c3e50b8983d5

This change made the Windows test failing (additional to the existing failure). Since the change did not worked as intended do you want to revert it or should I provide a patch on top?

The failure is that Clipboard#clearContents() does not guarantee to clear the clipboard (see also its javadoc). The fix is to first set anything and after clear.
It might work on Mac because from reading the code it seem to ignore the restriction to only clear own content. I'm not sure why it works reliable on Linux. Apparently the clipboard is empty on Linux when starting the test but clipboard is not empty when test starts on Windows.
Comment 8 Paul Pazderski CLA 2020-01-22 09:14:34 EST
PS: a small addition. Because the test is failing for another reason if I run the full suite but failing on this change if I run only TextHandlerTest I cannot guarantee it would fail on this change when running full suite. Anyway, since the clear does not work as intended it makes the test less reliable.
Comment 9 Eclipse Genie CLA 2020-01-25 06:53:46 EST
New Gerrit change created: https://git.eclipse.org/r/156560
Comment 10 Paul Pazderski CLA 2020-01-25 07:03:19 EST
(In reply to Paul Pazderski from comment #7)
> I'm not sure why it works reliable on
> Linux. Apparently the clipboard is empty on Linux when starting the test but
> clipboard is not empty when test starts on Windows.

After the automated test now succeeded I noticed that it run the 'non editable' before the 'editable' and therefore guarantee an empty clipboard already. Still a detail that should be fix.
Comment 12 Dani Megert CLA 2020-01-29 03:55:14 EST
(In reply to Eclipse Genie from comment #11)
> Gerrit change https://git.eclipse.org/r/156560 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=89b52c11dd898b72c7a7f538e66be37a6dd19d8f
> 
Is that supposed to fix the testEditableText test? If so, it did not work.
Comment 13 Paul Pazderski CLA 2020-01-29 04:14:17 EST
(In reply to Dani Megert from comment #12)
> (In reply to Eclipse Genie from comment #11)
> > Gerrit change https://git.eclipse.org/r/156560 was merged to [master].
> > Commit:
> > http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=89b52c11dd898b72c7a7f538e66be37a6dd19d8f
> > 
> Is that supposed to fix the testEditableText test? If so, it did not work.

It is only supposed to fix this test if run alone on Windows and as far as I can tell also on Mac. Clipboard clear does not clear (intentionally) foreign clipboard content. This is no problem in automated tests because testNonEditableText is run before and left an already empty clipboard.

It is not supposed to fix the remaining test failure on Mac I cannot investigate myself.
Comment 14 Dani Megert CLA 2020-01-31 03:41:04 EST
Kalyan please check whether testEditableText fails locally. If not, disable the test.
Comment 15 Kalyan Prasad Tatavarthi CLA 2020-02-05 04:42:32 EST
(In reply to Dani Megert from comment #14)
> Kalyan please check whether testEditableText fails locally. If not, disable
> the test.

This test fails locally on Mac.
Comment 16 Dani Megert CLA 2020-02-05 05:09:23 EST
(In reply to Kalyan Prasad Tatavarthi from comment #15)
> (In reply to Dani Megert from comment #14)
> > Kalyan please check whether testEditableText fails locally. If not, disable
> > the test.
> 
> This test fails locally on Mac.
Please investigate when you find some time.
Comment 17 Kalyan Prasad Tatavarthi CLA 2020-02-17 09:47:30 EST
(In reply to Dani Megert from comment #16)
> (In reply to Kalyan Prasad Tatavarthi from comment #15)
> > (In reply to Dani Megert from comment #14)
> > > Kalyan please check whether testEditableText fails locally. If not, disable
> > > the test.
> > 
> > This test fails locally on Mac.
> Please investigate when you find some time.

This test fails on Mac locally. I am investigating.
Comment 18 Dani Megert CLA 2020-02-25 09:47:40 EST
Ping!
Comment 19 Eclipse Genie CLA 2020-02-26 08:22:19 EST
New Gerrit change created: https://git.eclipse.org/r/158403
Comment 21 Kalyan Prasad Tatavarthi CLA 2020-02-26 10:21:55 EST
(In reply to Eclipse Genie from comment #20)
> Gerrit change https://git.eclipse.org/r/158403 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/
> ?id=97e79b8d8d90570bf1e16da0402d231a55dd44cc

This change disables testEditableText test on Mac OS.