eclipse-platform / eclipse.platform.ui

Eclipse Platform
https://projects.eclipse.org/projects/eclipse.platform
Eclipse Public License 2.0
81 stars 190 forks source link

failing tests: DeprecatedUIPreferencesAuto, UIPreferencesAuto.testWorkbenchPref, DeprecatedUIWizardsAuto #1351

Closed jukzi closed 1 year ago

jukzi commented 1 year ago

https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/ also reported on https://github.com/eclipse-platform/eclipse.platform.ui/pull/1348#issuecomment-1833398732

java.lang.AssertionError: 
Warning: Button {Always r&un in background}
    Actual Width -> 166
    Recommended Width -> 168
    at org.junit.Assert.fail(Assert.java:89)
    at org.junit.Assert.assertTrue(Assert.java:42)
    at org.eclipse.ui.tests.harness.util.DialogCheck.verifyButtonText(DialogCheck.java:173)
    at org.eclipse.ui.tests.harness.util.DialogCheck.verifyCompositeText(DialogCheck.java:135)
    at org.eclipse.ui.tests.harness.util.DialogCheck.verifyCompositeText(DialogCheck.java:143)
    at org.eclipse.ui.tests.harness.util.DialogCheck.verifyCompositeText(DialogCheck.java:143)
    at org.eclipse.ui.tests.harness.util.DialogCheck.verifyCompositeText(DialogCheck.java:143)
    at org.eclipse.ui.tests.harness.util.DialogCheck.verifyCompositeText(DialogCheck.java:143)
    at org.eclipse.ui.tests.harness.util.DialogCheck.verifyCompositeText(DialogCheck.java:143)
    at org.eclipse.ui.tests.harness.util.DialogCheck.verifyCompositeText(DialogCheck.java:143)
    at org.eclipse.ui.tests.harness.util.DialogCheck.verifyCompositeText(DialogCheck.java:143)
    at org.eclipse.ui.tests.harness.util.DialogCheck.verifyCompositeText(DialogCheck.java:143)
    at org.eclipse.ui.tests.harness.util.DialogCheck.assertDialogTexts(DialogCheck.java:88)
    at org.eclipse.ui.tests.dialogs.DeprecatedUIPreferencesAuto.testLocalHistoryPref(DeprecatedUIPreferencesAuto.java:79)
[Test Result](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/) (19 failures )
[org.eclipse.ui.tests.dialogs.UIDialogsAuto.testCopyMoveProject](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/UIDialogsAuto/testCopyMoveProject/)
[org.eclipse.ui.tests.dialogs.UIDialogsAuto.testEditorSelection](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/UIDialogsAuto/testEditorSelection/)
[org.eclipse.ui.tests.dialogs.UIWizardsAuto.testNewProjectPage1](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/UIWizardsAuto/testNewProjectPage1/)
[org.eclipse.ui.tests.dialogs.UIWizardsAuto.testNewProjectPage2](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/UIWizardsAuto/testNewProjectPage2/)
[org.eclipse.ui.tests.dialogs.DeprecatedUIWizardsAuto.testNewProjectPage1](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/DeprecatedUIWizardsAuto/testNewProjectPage1/)
[org.eclipse.ui.tests.dialogs.DeprecatedUIWizardsAuto.testNewProjectPage2](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/DeprecatedUIWizardsAuto/testNewProjectPage2/)
[org.eclipse.ui.tests.dialogs.UIPreferencesAuto.testDefaultTextEditorPref](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/UIPreferencesAuto/testDefaultTextEditorPref/)
[org.eclipse.ui.tests.dialogs.UIPreferencesAuto.testPerspectivesPref](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/UIPreferencesAuto/testPerspectivesPref/)
[org.eclipse.ui.tests.dialogs.UIPreferencesAuto.testAppearancePref](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/UIPreferencesAuto/testAppearancePref/)
[org.eclipse.ui.tests.dialogs.UIPreferencesAuto.testWorkbenchPref](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/UIPreferencesAuto/testWorkbenchPref/)
[org.eclipse.ui.tests.dialogs.UIPreferencesAuto.testFileEditorsPref](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/UIPreferencesAuto/testFileEditorsPref/)
[org.eclipse.ui.tests.dialogs.UIPreferencesAuto.testLocalHistoryPref](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/UIPreferencesAuto/testLocalHistoryPref/)
[org.eclipse.ui.tests.compare.UIComparePreferencesAuto.testCompareViewersPref](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.compare/UIComparePreferencesAuto/testCompareViewersPref/)
[org.eclipse.ui.tests.dialogs.DeprecatedUIPreferencesAuto.testDefaultTextEditorPref](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/DeprecatedUIPreferencesAuto/testDefaultTextEditorPref/)
[org.eclipse.ui.tests.dialogs.DeprecatedUIPreferencesAuto.testPerspectivesPref](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/DeprecatedUIPreferencesAuto/testPerspectivesPref/)
[org.eclipse.ui.tests.dialogs.DeprecatedUIPreferencesAuto.testAppearancePref](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/DeprecatedUIPreferencesAuto/testAppearancePref/)
[org.eclipse.ui.tests.dialogs.DeprecatedUIPreferencesAuto.testWorkbenchPref](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/DeprecatedUIPreferencesAuto/testWorkbenchPref/)
[org.eclipse.ui.tests.dialogs.DeprecatedUIPreferencesAuto.testFileEditorsPref](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/DeprecatedUIPreferencesAuto/testFileEditorsPref/)
[org.eclipse.ui.tests.dialogs.DeprecatedUIPreferencesAuto.testLocalHistoryPref](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/DeprecatedUIPreferencesAuto/testLocalHistoryPref/)

similar fail: https://github.com/eclipse-platform/eclipse.platform.ui/issues/30

iloveeclipse commented 1 year ago

@SyntevoAlex : this test fails affects Linux builds only. So I suspect this could be a side effect of https://github.com/eclipse-platform/eclipse.platform.swt/pull/915. Would be nice if you could look at.

SyntevoAlex commented 1 year ago

I'll have a look soon(tm)

mickaelistria commented 1 year ago

These failures are making much harder to trust all other incoming PRs. If https://github.com/eclipse-platform/eclipse.platform.swt/pull/915 is to blame (this still needs to be confirmed), we should probably revert it to let other work happen more easily.

iloveeclipse commented 1 year ago

Just a note: usually I would immediately identify the offending commit, but this week I have no time to do that. So please whoever interested in having clean test pipeline, please check which change caused that & if there is a quick fix possible or revert is needed.

SyntevoAlex commented 1 year ago

I hope to have some answers in a few hours. If you want to revert PR, I think I will just abandon it, because it has marginal value anyway. I hoped to fix a JVM crash but it didn't help.

laeubi commented 1 year ago

Actually I can only see that some buttons have changed size by some pixels so I wonder why we check pixel size at all e.g in

Actual Width -> 166
Recommended Width -> 168

who/how one defines the "Recommended Width"?

SyntevoAlex commented 1 year ago

I tried to run the failing test org.eclipse.ui.tests.dialogs.DeprecatedUIPreferencesAuto.testLocalHistoryPref.

But it throws java.lang.NullPointerException: Cannot invoke "org.eclipse.ui.internal.WorkbenchPlugin.getPreferenceManager()" because the return value of "org.eclipse.ui.internal.WorkbenchPlugin.getDefault()" is null.

It seems that tests depend on order of running them, and somewhere WorkbenchPlugin is initialized. I tried running bigger packages, but still didn't succeed to run the test.

I guess I give up there.

SyntevoAlex commented 1 year ago

who/how one defines the "Recommended Width"?

https://github.com/eclipse-platform/eclipse.platform.ui/blob/5f9ae8fafaede22e181b68873fbf81b1d3cd284a/tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/DialogCheck.java#L181-L206

SyntevoAlex commented 1 year ago

If you like, revert https://github.com/eclipse-platform/eclipse.platform.swt/pull/915

jukzi commented 1 year ago

I tried to run the failing test

did you launch them as PLugin-test?

iloveeclipse commented 1 year ago

If you like, revert eclipse-platform/eclipse.platform.swt#915

We don't know if that is the root cause and even if that is, we don't know if there is a simple test fix for that.

I guess I give up there.

I have no time this week, but I will try to identify the root cause next week if no one jumps in before.

SyntevoAlex commented 1 year ago

did you launch them as PLugin-test?

I think that I'm not interested in figuring why the test doesn't run for me. It just doesn't and I don't have more time to spend on it.

iloveeclipse commented 1 year ago

We don't know if that is the root cause and even if that is, we don't know if there is a simple test fix for that.

I've just quickly run UIPreferencesAuto & DeprecatedUIPreferencesAuto on RHEL 7.9 / gtk3-3.22.30 and I see no fails.

@akurtakov : could it be, our Linux images were updated with new GTK version, or something like this? See https://ci.eclipse.org/releng/job/Build-Docker-images/ Do github actions use same images or something different?

akurtakov commented 1 year ago

@iloveeclipse eclipse.platform.ui uses centos-latest https://github.com/eclipse-platform/eclipse.platform.ui/blob/6e1920564ae8a68e344f22c3d5c37a2243887e13/Jenkinsfile#L8 which as far as I'm aware is centos 8-latest and is maintained by EF team in https://github.com/eclipse-cbi/dockerfiles . I don't have the time to monitor changes there too.

laeubi commented 1 year ago

Do github actions use same images or something different?

Github action uses latest ubuntu see

akurtakov commented 1 year ago

I see that centos has been removed from dockerfiles too and this has been the default for long period. So maybe @eclipse-platform/eclipsefdn-releng can share what the plan is ? Should projects actively move away of centos* images ? If yes to what? When will plan be announced as relying on non uptodate images is in general a terrible idea?

mickaelistria commented 1 year ago

I can reproduce the issue locally on latest Fedora. I tried reverting the suggested patch, but then i get

java.lang.UnsatisfiedLinkError: 'void org.eclipse.swt.internal.gtk3.GTK3.gtk_style_context_invalidate(long)'
    at org.eclipse.swt.internal.gtk3.GTK3.gtk_style_context_invalidate(Native Method)

So I reverted SWT to 434d1ddbe36ed49a4981bbad67a8d9cb7e636043 and binaries to v4964r2d (prior to the changes) -> test are fine Then I moved back to the post-change state (SWT 1138e71b4fe96e2a5474f367be2878ced4d16b18 , binaries v4964r3) -> tests are failing.

This seems enough to me to qualify this change causes the regression. I'm creating the revert.

mickaelistria commented 1 year ago

Note that I'm saying "regression" here for "test failure" but maybe the change is still good overall and tests need adaptation, but that seems not in the scope of anyone to investigate it now and we can't afford continuous test failures; if anyone wants to spend more effort trying to make the change work without breaking tests, and that can mean updating the tests, it would be more than welcome. But I'd encourage anyone willing to work on this topic to try building a pure SWT reproducer for the test failures we've faced here first to prevent this issue from resurfacing.