Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jukzi opened this issue Nov 30, 2023 · 18 comments · Fixed by eclipse-platform/eclipse.platform.swt#931
Labels
bug Something isn't working regression test junit test related things

Comments

@jukzi
Copy link
Contributor

jukzi commented Nov 30, 2023

https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/
also reported on #1348 (comment)

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: #30

@jukzi jukzi added bug Something isn't working regression test junit test related things labels Nov 30, 2023
@iloveeclipse
Copy link
Member

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

@SyntevoAlex
Copy link
Member

I'll have a look soon(tm)

@mickaelistria
Copy link
Contributor

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

@iloveeclipse
Copy link
Member

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
Copy link
Member

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
Copy link
Contributor

laeubi commented Dec 4, 2023

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
Copy link
Member

SyntevoAlex commented Dec 4, 2023

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
Copy link
Member

who/how one defines the "Recommended Width"?

private static void verifyLabelText(Label label) {
if (!label.isVisible())
return;
String widget = label.toString();
Point size = label.getSize();
String labelText = label.getText();
if (labelText == null || labelText.isEmpty())
return;
//compute the size with no line wrapping
Point preferred = label.computeSize(SWT.DEFAULT, SWT.DEFAULT);
//if (size.y/preferred.y) == X, then label spans X lines, so divide
//the calculated value of preferred.x by X
if (preferred.y * size.y > 0) {
preferred.y /= countLines(label.getText());
if (size.y / preferred.y > 1) {
preferred.x /= (size.y / preferred.y);
}
}
String message = new StringBuilder("Warning: ").append(widget).append(
"\n\tActual Width -> ").append(size.x).append(
"\n\tRecommended Width -> ").append(preferred.x).toString();
if (preferred.x > size.x) {
//close the dialog
label.getShell().dispose();
assertTrue(message, false);
}

@SyntevoAlex
Copy link
Member

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

@jukzi
Copy link
Contributor Author

jukzi commented Dec 4, 2023

I tried to run the failing test

did you launch them as PLugin-test?

@iloveeclipse
Copy link
Member

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
Copy link
Member

SyntevoAlex commented Dec 4, 2023

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
Copy link
Member

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
Copy link
Member

@iloveeclipse eclipse.platform.ui uses centos-latest

label "centos-latest"
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
Copy link
Contributor

laeubi commented Dec 5, 2023

Do github actions use same images or something different?

Github action uses latest ubuntu see

@akurtakov
Copy link
Member

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
Copy link
Contributor

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
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression test junit test related things
Projects
None yet
6 participants