[mozscreenshots] failed to create screenshot GdkPixbuf on new Wayland-enabled environment
Categories
(Core :: Widget: Gtk, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox115 | --- | fixed |
People
(Reporter: ahal, Assigned: stransky)
References
Details
Attachments
(1 file)
We're starting to stand up tests that run in a VM with Wayland enabled. One issue is that Mochitest's screenshot on fail feature (which uses mozscreenshots via screentopng
), is failing with:
[task 2023-05-26T19:35:20.744Z] 19:35:20 INFO - TEST-INFO | started process screentopng
[task 2023-05-26T19:35:20.816Z] 19:35:20 INFO - (screentopng:15883): Gdk-CRITICAL **: 19:35:20.816: gdk_pixbuf_get_from_surface: assertion 'width > 0 && height > 0' failed
[task 2023-05-26T19:35:20.817Z] 19:35:20 INFO - /home/ubuntu/tasks/task_168512798664919/build/tests/bin/screentopng: failed to create screenshot GdkPixbuf
[task 2023-05-26T19:35:20.823Z] 19:35:20 INFO - TEST-INFO | screentopng: exit 1
Full log:
https://treeherder.mozilla.org/logviewer?job_id=417197398&repo=try&lineNumber=8951
There's a very high chance that there's nothing wrong with mozscreenshots here and that there's an issue with how the test environment is set up. If this is the case, I'm hoping that someone knowledgeable could help point us in the right direction.
Reporter | ||
Updated•2 years ago
|
Reporter | ||
Comment 1•2 years ago
|
||
Updating component again according to ./mach file-info bugzilla-component
.
Comment 2•2 years ago
|
||
Looks like the screenshot utility is depending on GNOME Shell with Wayland.
Does the test environment have GNOME Shell?
Reporter | ||
Comment 3•2 years ago
|
||
Good catch, I'd guess not. I also found a user reporting this error when they had GDK_BACKEND
explicitly set to x11
. We'll need to wait for aerickson to get back from PTO later this week.
Andrew (for when you get back), could you verify whether GNOME Shell is installed or GDK_BACKEND is set?
Comment 4•2 years ago
|
||
What compositor are the wayland tests using, BTW?
Assignee | ||
Comment 5•2 years ago
|
||
Andrew, where is the Wayland environment set? We need to use Gnome Shell / Mutter for testing. It can be configured to run headless and also allows to set scale factor. And provides Gnome Shell extension to get a screenshot.
Assignee | ||
Comment 6•2 years ago
|
||
Do I understand correctly that https://searchfox.org/mozilla-central/source/taskcluster/scripts/tester/test-linux.sh is used ? If so can try to update it for gnome-session.
Assignee | ||
Comment 7•2 years ago
|
||
So no, I was wrong. We don't need gnome session for that, Mutter provides such interface too:
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1698
Assignee | ||
Comment 8•2 years ago
|
||
There's also python helper scrip for it: https://gitlab.gnome.org/GNOME/mutter/uploads/9a143d445398e26b0debef6d38b7b822/gnome-screen-cast.py
Assignee | ||
Comment 9•2 years ago
|
||
I see the bug too locally, will look at it.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 10•2 years ago
•
|
||
Unfortunately Gnome 41.0 restricted access to org.gnome.Shell.Screenshot interface to internal components only:
https://gitlab.gnome.org/GNOME/gimp/-/issues/7591
But we can use gnome-screenshot utility for it.
Assignee | ||
Comment 11•2 years ago
|
||
Assignee | ||
Comment 12•2 years ago
|
||
Andrew, to get it working you need to install /usr/bin/gnome-screenshot utility, it's provided by gnome-screenshot package.
Comment 13•2 years ago
|
||
Reporter | ||
Comment 14•2 years ago
|
||
Comment on attachment 9336507 [details]
Bug 1835707 [Linux] Use gnome-screenshot by screentopng utility to get screenshot on Wayland r?emilio
Beta/Release Uplift Approval Request
- User impact if declined: The screentopng utility will be broken on Wayland environments, impacting the Mochitest screenshots feature, screenshots test suite and other things.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): I believe mozscreenshots is only used by test infrastructure and other extraneous tooling. I may be wrong though.
- String changes made/needed:
- Is Android affected?: No
Reporter | ||
Comment 15•2 years ago
|
||
Comment on attachment 9336507 [details]
Bug 1835707 [Linux] Use gnome-screenshot by screentopng utility to get screenshot on Wayland r?emilio
Oh nvm, I got confused and yesterday's merge was only beta -> release. So this patch is already riding 115.
Comment 16•2 years ago
|
||
bugherder |
Comment 17•2 years ago
|
||
I see gnome-screenshot available at /usr/bin/gnome-screenshot in the VM. I've VNC'ed into my test host and I can create screenshots.
Try jobs are unable to find it?
Reporter | ||
Comment 18•2 years ago
|
||
The needinfo was a little stale and predates Martin's patch that landed two days ago. Thanks for verifying that gnome-screenshot
is present. I haven't kicked off a new try run yet to test Martin's fix, but will do so shortly.
Reporter | ||
Comment 19•2 years ago
|
||
I can confirm that the mochitest screenshots are working again:
https://firefoxci.taskcluster-artifacts.net/AZ0rfH--T9iaOrBz3GleLw/0/public/test_info/mozilla-test-fail-screenshot_bh8jwugn.png
Thanks Martin!
What compositor are the wayland tests using, BTW?
Pretty sure it's mutter, but I'll confirm.
Description
•