Perma dom/tests/mochitest/bugs/test_sizetocontent_clamp.html failure on new Ubuntu 22.04 Wayland pool
Categories
(Core :: Widget: Gtk, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox121 | --- | fixed |
People
(Reporter: ahal, Assigned: stransky)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
This is happening on a new Ubuntu 22.04 Wayland enabled pool we're in the process of standing up.
Example failure log:
https://treeherder.mozilla.org/logviewer?job_id=431033476&repo=try&lineNumber=8932
[task 2023-10-02T16:24:20.751Z] 16:24:20 INFO - TEST-START | dom/tests/mochitest/bugs/test_sizetocontent_clamp.html
[task 2023-10-02T16:24:21.690Z] 16:24:21 INFO - TEST-INFO | started process screentopng
[task 2023-10-02T16:24:25.717Z] 16:24:25 INFO - TEST-INFO | screentopng: exit 0
[task 2023-10-02T16:24:25.717Z] 16:24:25 INFO - Buffered messages logged at 16:24:20
[task 2023-10-02T16:24:25.717Z] 16:24:25 INFO - must wait for load
[task 2023-10-02T16:24:25.717Z] 16:24:25 INFO - Buffered messages logged at 16:24:21
[task 2023-10-02T16:24:25.717Z] 16:24:25 INFO - must wait for load
[task 2023-10-02T16:24:25.718Z] 16:24:25 INFO - must wait for focus
[task 2023-10-02T16:24:25.720Z] 16:24:25 INFO - got resize: 300 300
[task 2023-10-02T16:24:25.721Z] 16:24:25 INFO - got resize: 122 100
[task 2023-10-02T16:24:25.721Z] 16:24:25 INFO - Buffered messages finished
[task 2023-10-02T16:24:25.723Z] 16:24:25 INFO - TEST-UNEXPECTED-FAIL | dom/tests/mochitest/bugs/test_sizetocontent_clamp.html | innerWidth should be between 100 and 100 but it was: 122
[task 2023-10-02T16:24:25.723Z] 16:24:25 INFO - SimpleTest.ok@SimpleTest/SimpleTest.js:426:16
[task 2023-10-02T16:24:25.723Z] 16:24:25 INFO - test/</w.onresize@dom/tests/mochitest/bugs/test_sizetocontent_clamp.html:53:9
[task 2023-10-02T16:24:25.723Z] 16:24:25 INFO - EventHandlerNonNull*test/<@dom/tests/mochitest/bugs/test_sizetocontent_clamp.html:44:5
[task 2023-10-02T16:24:25.724Z] 16:24:25 INFO - SimpleTest.waitForFocus/<@SimpleTest/SimpleTest.js:1058:13
[task 2023-10-02T16:24:25.725Z] 16:24:25 INFO - TEST-PASS | dom/tests/mochitest/bugs/test_sizetocontent_clamp.html | innerHeight should be around 100 but it was: 100
[task 2023-10-02T16:24:25.726Z] 16:24:25 INFO - must wait for focus
[task 2023-10-02T16:24:25.731Z] 16:24:25 INFO - GECKO(14376) | 1696263861782 Marionette TRACE Received observer notification browser-delayed-startup-finished
[task 2023-10-02T16:24:25.732Z] 16:24:25 INFO - GECKO(14376) | console.error: (new TypeError("error loading dynamically imported module: chrome://global/content/elements/moz-button-group.mjs", ""))
[task 2023-10-02T16:24:25.733Z] 16:24:25 INFO - GECKO(14376) | MEMORY STAT | vsize 2443MB | residentFast 122MB | heapAllocated 14MB
[task 2023-10-02T16:24:25.733Z] 16:24:25 INFO - TEST-OK | dom/tests/mochitest/bugs/test_sizetocontent_clamp.html | took 1326ms
It's unclear whether this is a result of Wayland, upgrading to Ubuntu 22.04 or hardware characteristics of the new workers. The test will be skipped on this new platform.
Updated•1 year ago
|
Assignee | ||
Comment 1•1 year ago
|
||
It's Wayland only. XWayland works fine:
Works:
MOZ_ENABLE_WAYLAND=0 ./mach test dom/tests/mochitest/bugs/test_sizetocontent_clamp.html
Fails:
MOZ_ENABLE_WAYLAND=1 ./mach test dom/tests/mochitest/bugs/test_sizetocontent_clamp.html
Looks like widget issue.
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 2•1 year ago
|
||
Looks like we fail to resize hidden (unmapped) window on Wayland.
Assignee | ||
Comment 3•1 year ago
|
||
(In reply to Martin Stránský [:stransky] (ni? me) from comment #2)
Looks like we fail to resize hidden (unmapped) window on Wayland.
I'm wrong here; It's because mutter (Wayland compositor) set's minimal window sizes as:
0:05.34 GECKO(72201) [2745786.884] -> xdg_toplevel@61.set_min_size(180, 132)
0:05.34 GECKO(72201) [2745786.886] -> xdg_toplevel@61.set_max_size(8140, 8140)
Assignee | ||
Comment 4•1 year ago
|
||
Min window size is based on screen size so it differs with screen resolution. For 4K/200% scale is 180.
Assignee | ||
Comment 5•1 year ago
|
||
I investigated it more and it's caused directly by Gtk/Wayland backend (or a bug in Gtk/X11 code).
We use CSD window decorations which means GtkWindow contains GtkHeaderbar widget. If widget minimal size is computed it checks minimal size of child widgets which is GtkHeaderbar and 180 pixels in Adwaita theme.
But why we don't see this bug on X11? Because gtk_window_should_use_csd() returns false by default on X11 so we create GtkWindow without CSD/GtkHeaderbar widget. GtkHeaderbar is added later in nsWindow::SetDrawsInTitlebar() where we enable rendering to GtkWindow titlebar and force GtkWindow to use CSD.
But widget minimal sizes are cached by Gtk so widget size cache on X11 contains old non-CSD widget size which is 0 for non-CSD GtkWindow.
There are some options:
- Make gtk_window_should_use_csd() return true on both X11 and Wayland. We can set GTK_CSD env variable to force CSD for X11 from beginning and adjust the tests for both X11 and Wayland (and perhaps other tests which may fail here as widget minimal size is changed).
- Adjust the tests for Wayland only.
Reporter | ||
Comment 7•1 year ago
|
||
I don't really have expertise or opinions on specific issues like this, and I see you're already a peer in this module so happy to defer to your judgement. Maybe :karlt has thoughts?
Reporter | ||
Comment 8•1 year ago
|
||
I guess I do have an opinion after all..
If option 1 means we might fix other tests, that sounds great to me. But I have no idea what other consequences changing gtk_window_should_use_csd
might have.
Comment 9•1 year ago
|
||
Thank you, Martin for identifying the reasons for the difference in behavior.
Should the bug summary say "permafail" instead of "intermittent" then?
Given bug 764240, I expected the test to be testing that the window is not too small. I don't know why it cares if the window is slightly too large.
The test already has variations across platforms. I'd just adjust innerWidthMax
in the test on Linux to be large enough to accommodate the variability of GTK themes, or at least accommodate the default GTK theme.
Reporter | ||
Comment 10•1 year ago
|
||
Hm, yeah I don't see it passing anywhere.. must have been a copy/paste error from one of the dozens of other bugs I was filing.
Assignee | ||
Comment 11•1 year ago
|
||
(In reply to Andrew Halberstadt [:ahal] from comment #8)
I guess I do have an opinion after all..
If option 1 means we might fix other tests, that sounds great to me. But I have no idea what other consequences changing
gtk_window_should_use_csd
might have.
That means we create the widgets as intended but they have a minimal size by default. It may break tests but we'll test what we ship (as CSD will be enabled later anyway). You can try to set GTK_CSD=1 env variable and look at test results on X11.
Assignee | ||
Comment 12•1 year ago
|
||
Will look at the GTK_CSD variant to use correct window creation on both X11 and Wayland.
Assignee | ||
Comment 13•1 year ago
|
||
Set GTK_CSD env variable if we use CSD decorations. It ensures that correct GtkWindow sizes are cached
by Gtk size cache on X11 on gtk_widget_realize() call.
Assignee | ||
Comment 14•1 year ago
|
||
Depends on D191172
Assignee | ||
Comment 15•1 year ago
|
||
Let's look at try how it passes.
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 16•1 year ago
|
||
Updated•1 year ago
|
Updated•1 year ago
|
Comment 17•1 year ago
|
||
Comment 18•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/0d8b97ff600c
https://hg.mozilla.org/mozilla-central/rev/e9280f35a02b
Description
•