Closed Bug 1835707 Opened 2 years ago Closed 2 years ago

[mozscreenshots] failed to create screenshot GdkPixbuf on new Wayland-enabled environment

Categories

(Core :: Widget: Gtk, defect)

defect

Tracking

()

VERIFIED FIXED
115 Branch
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.

Component: mozscreenshots → Screenshots
Product: Testing → Firefox
Summary: failed to create screenshot GdkPixbuf on new Wayland-enabled environment → [ci] failed to create screenshot GdkPixbuf on new Wayland-enabled environment
Version: Default → Trunk

Updating component again according to ./mach file-info bugzilla-component.

Component: Screenshots → General
Summary: [ci] failed to create screenshot GdkPixbuf on new Wayland-enabled environment → [mozscreenshots] failed to create screenshot GdkPixbuf on new Wayland-enabled environment

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?

Flags: needinfo?(aerickson)

What compositor are the wayland tests using, BTW?

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.

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.

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

I see the bug too locally, will look at it.

Assignee: nobody → stransky
Component: General → Widget: Gtk
Product: Firefox → Core

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.

Andrew, to get it working you need to install /usr/bin/gnome-screenshot utility, it's provided by gnome-screenshot package.

Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/2dee01e7126e [Linux] Use gnome-screenshot by screentopng utility to get screenshot on Wayland r=emilio

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
Attachment #9336507 - Flags: approval-mozilla-beta?

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.

Attachment #9336507 - Flags: approval-mozilla-beta?
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 115 Branch

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?

Flags: needinfo?(aerickson)

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.

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.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: