AttributeError in graphics/1_maximum_resolution_* tests on 22.04

Bug #1968943 reported by Pierre Equoy
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Checkbox Provider - Base
Fix Released
Medium
Pierre Equoy

Bug Description

plainbox-provider-checkbox 0.64.0~rc1~ppa~ubuntu22.04.1

Image: 22.04
DE: Wayland (same result in Xorg)

When running graphics/1_maximum_resolution_*, the test output fails because of a Python error. The "current resolution" is set to "\nPlease switch to the maximum resolution \nfor every graphic tests" instead of an actual resolution, yet the test is still marked as passed by default.

When testing, the screen resolution is 3840x2160 (with integer scaling automatically set after installation at 200%).

I guess the Gdk module has been updated in 22.04 and breaks our script.

-------------[ Running job 28 / 55. Estimated time left: unknown ]--------------
---[ Test maximum supported resolution for Intel Corporation PCI ID 0x9a70 ]----
ID: com.canonical.certification::graphics/1_maximum_resolution_PCI_ID_0x9a70
Category: com.canonical.plainbox::graphics
PURPOSE:
  This test will verify the maximum supported resolution on the Intel Corporation PCI ID 0x9a70 graphics card.
STEPS:
  1. Select the Intel Corporation PCI ID 0x9a70 graphics card (a reboot may be necessary)
  2. Consult the system's specifications and locate the screen's maximum supported resolution.
  3. Click on Test to display the maximum resolution that can be used by Ubuntu on the current display.
VERIFICATION:
  Is this the maximum resolution for the display connected to the Intel Corporation PCI ID 0x9a70 graphics card?
Pick an action
    => press ENTER to continue
  c => add a comment
  s => skip this job
  q => save the session and quit
[csq]:
... 8< -------------------------------------------------------------------------
<string>:1: PyGIWarning: Gdk was imported without specifying a version first. Use gi.require_version('Gdk', '4.0') before import to ensure that the right version gets loaded.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/gi/overrides/__init__.py", line 32, in __getattr__
    return getattr(self._introspection_module, name)
  File "/usr/lib/python3/dist-packages/gi/module.py", line 123, in __getattr__
    raise AttributeError("%r object has no attribute %r" % (
AttributeError: 'gi.repository.Gdk' object has no attribute 'Screen'
Maximum resolution: 3840x2160
Current resolution: \nPlease switch to the maximum resolution \nfor every graphic tests
------------------------------------------------------------------------- >8 ---
Outcome: job needs verification
Please decide what to do next:
  outcome: job needs verification
  comments: none
Pick an action
  c => add a comment
  p => set outcome to pass
  f => set outcome to fail
  s => set outcome to skip
  r => re-run this job
    => set suggested outcome [job passed]

$ dpkg -l | grep -i gobject
ii gir1.2-accountsservice-1.0:amd64 22.07.5-2ubuntu1 amd64 GObject introspection data for AccountService
ii gir1.2-adw-1:amd64 1.1.0-1ubuntu2 amd64 GObject introspection files for libadwaita
ii gir1.2-atk-1.0:amd64 2.36.0-3build1 amd64 ATK accessibility toolkit (GObject introspection)
ii gir1.2-atspi-2.0:amd64 2.44.0-3 amd64 Assistive Technology Service Provider (GObject introspection)
ii gir1.2-clutter-1.0:amd64 1.26.4+dfsg-4build1 amd64 GObject introspection data for the Clutter 1.0 library
ii gir1.2-cogl-1.0:amd64 1.22.8-3build1 amd64 GObject introspection data for the Cogl 1.0 library
ii gir1.2-coglpango-1.0:amd64 1.22.8-3build1 amd64 GObject introspection data for the CoglPango 1.0 library
ii gir1.2-dee-1.0 1.2.7+17.10.20170616-6ubuntu4 amd64 GObject introspection data for the Dee library
ii gir1.2-gck-1:amd64 3.40.0-4 amd64 GObject introspection data for the GCK library
ii gir1.2-gcr-3:amd64 3.40.0-4 amd64 GObject introspection data for the GCR library
ii gir1.2-gdesktopenums-3.0:amd64 42.0-1ubuntu1 amd64 GObject introspection for GSettings desktop-wide schemas
ii gir1.2-gdkpixbuf-2.0:amd64 2.42.8+dfsg-1 amd64 GDK Pixbuf library - GObject-Introspection
ii gir1.2-gdm-1.0:amd64 42.0-1ubuntu2 amd64 GObject introspection data for the GNOME Display Manager
ii gir1.2-glib-2.0:amd64 1.72.0-1 amd64 Introspection data for GLib, GObject, Gio and GModule
ii gir1.2-gmenu-3.0:amd64 3.36.0-1ubuntu3 amd64 GObject introspection data for the GNOME menu library
ii gir1.2-goocanvas-2.0:amd64 2.0.4-1build1 amd64 GObject introspection data for GooCanvas - gir bindings
ii gir1.2-gst-plugins-base-1.0:amd64 1.20.1-1 amd64 GObject introspection data for the GStreamer Plugins Base library
ii gir1.2-gstreamer-1.0:amd64 1.20.1-1 amd64 GObject introspection data for the GStreamer library
ii gir1.2-gweather-3.0:amd64 40.0-5build1 amd64 GObject introspection data for the GWeather library
ii gir1.2-handy-1:amd64 1.6.1-1 amd64 GObject introspection files for libhandy
ii gir1.2-harfbuzz-0.0:amd64 2.7.4-1ubuntu3 amd64 OpenType text shaping engine (GObject introspection data)
ii gir1.2-javascriptcoregtk-4.0:amd64 2.36.0-2ubuntu1 amd64 JavaScript engine library from WebKitGTK - GObject introspection data
ii gir1.2-mutter-10:amd64 42.0-3ubuntu1 amd64 GObject introspection data for Mutter
ii gir1.2-nm-1.0:amd64 1.36.4-2ubuntu1 amd64 GObject introspection data for the libnm library
ii gir1.2-nma-1.0:amd64 1.8.34-1ubuntu1 amd64 GObject introspection data for libnma
ii gir1.2-packagekitglib-1.0 1.2.5-2ubuntu2 amd64 GObject introspection data for the PackageKit GLib library
ii gir1.2-polkit-1.0 0.105-33 amd64 GObject introspection data for PolicyKit
ii gir1.2-rb-3.0:amd64 3.4.4-5ubuntu1 amd64 GObject introspection data for the rhythmbox music player
ii gir1.2-secret-1:amd64 0.20.5-2 amd64 Secret store (GObject-Introspection)
ii gir1.2-soup-2.4:amd64 2.74.2-3 amd64 GObject introspection data for the libsoup HTTP library
ii gir1.2-totem-1.0:amd64 42.0-1ubuntu1 amd64 GObject introspection data for Totem media player
ii gir1.2-totemplparser-1.0:amd64 3.26.6-1build1 amd64 GObject introspection data for the Totem Playlist Parser library
ii gir1.2-udisks-2.0:amd64 2.9.4-1ubuntu2 amd64 GObject based library to access udisks2 - introspection data
ii gir1.2-unity-7.0:amd64 7.1.4+19.04.20190319-6build1 amd64 GObject introspection data for the Unity library
ii gir1.2-upowerglib-1.0:amd64 0.99.17-1 amd64 GObject introspection data for upower
ii gir1.2-vte-2.91:amd64 0.68.0-1 amd64 GObject introspection data for the VTE library
ii gir1.2-webkit2-4.0:amd64 2.36.0-2ubuntu1 amd64 Web content engine library for GTK - GObject introspection data
ii gir1.2-wnck-3.0:amd64 40.1-1 amd64 GObject introspection data for the WNCK library
ii libcairo-gobject-perl:amd64 1.005-3build1 amd64 integrate Cairo into the Glib type system in Perl
ii libcairo-gobject2:amd64 1.16.0-5ubuntu2 amd64 Cairo 2D vector graphics library (GObject library)
ii libdazzle-1.0-0:amd64 3.44.0-1 amd64 feature-filled library for GTK+ and GObject
ii libdazzle-common 3.44.0-1 all feature-filled library for GTK+ and GObject (common files)
ii libgee-0.8-2:amd64 0.20.5-2 amd64 GObject based collection and utility library
ii libgexiv2-2:amd64 0.14.0-1build1 amd64 GObject-based wrapper around the Exiv2 library
ii libgirepository-1.0-1:amd64 1.72.0-1 amd64 Library for handling GObject introspection data (runtime library)
ii libglib-object-introspection-perl 0.049-1+build2 amd64 Perl bindings for gobject-introspection libraries
ii libglib-perl:amd64 3:1.329.3-2build1 amd64 interface to the GLib and GObject libraries
ii libgom-1.0-0:amd64 0.4-1build2 amd64 Object mapper from GObjects to SQLite
ii libgssdp-1.2-0:amd64 1.4.0.1-2build1 amd64 GObject-based library for SSDP
ii libgudev-1.0-0:amd64 1:237-2build1 amd64 GObject-based wrapper library for libudev
ii libgupnp-1.2-1:amd64 1.4.3-1 amd64 GObject-based library for UPnP
ii libmanette-0.2-0:amd64 0.2.6-3build1 amd64 Simple GObject game controller library
ii libnm0:amd64 1.36.4-2ubuntu1 amd64 GObject-based client library for NetworkManager
ii libpolkit-gobject-1-0:amd64 0.105-33 amd64 PolicyKit Authorization API
ii libudisks2-0:amd64 2.9.4-1ubuntu2 amd64 GObject based library to access udisks2
ii python3-gi 3.42.0-3build1 amd64 Python 3 bindings for gobject-introspection libraries
ii python3-gi-cairo 3.42.0-3build1 amd64 Python 3 Cairo bindings for the GObject library

Related branches

Pierre Equoy (pieq)
description: updated
Scott Hu (huntu207)
tags: added: jammy-test
Pierre Equoy (pieq)
Changed in plainbox-provider-checkbox:
status: New → Confirmed
importance: Undecided → Medium
milestone: none → 0.65.0
Revision history for this message
Pierre Equoy (pieq) wrote :

Summary of my researches so far:

The job is in plainbox-provider-checkbox:

https://git.launchpad.net/plainbox-provider-checkbox/tree/units/graphics/jobs.pxu#n130

1. It sources graphics_env.sh[1] for AMD discrete GPUs
2. It uses xrandr to guess the max resolution from the primary screen output.
3. Then it uses a Python one-liner and Gdk to find the resolution of the current default screen.

I'm not sure if 1. is needed at all for this job.

xrandr cannot be used in Wayland, so we have to replace 2. with either

- a "if wayland then... else if xorg then..." version, so we can use xrandr in one case and gnome-randr in the other
- find a more "close to the metal" option that would work in any cases. For instance, access /sys/class/drm/*/modes that contain a list of supported resolutions for every monitor available.

3. As shown in the bug description, Gdk.Screen has been removed in Gdk 4.0 (it was deprecated in Gdk 3.22). Unfortunately, Gdk 3 and Gdk 4 have different classes and methods to access what we want (the current resolution of the default screen), so it would become quite complicated (but possible) to handle both 20.04 and 22.04 with the same script. Might need to find a better approach to this.

[1] https://git.launchpad.net/plainbox-provider-checkbox/tree/bin/graphics_env.sh

Revision history for this message
Pierre Equoy (pieq) wrote :

For what it's worth, I had a quick chat in #ubuntu-desktop about getting screen resolution, and ROAF mentioned xrandr *does* work on XWayland, which gnome runs!

So it might still be a relevant option, at least to get something as simple as a screen resolution...

Revision history for this message
Pierre Equoy (pieq) wrote :

Unfortunately, xrandr does not behave as expected when run on XWayland. Namely, if you select a lower resolution, xrandr on Wayland will only list this resolution as the maximum, so xrandr cannot be used to grab the max resolution on Wayland.

I started playing with /sys/class/drm/card*/modes files that contain a list of supported resolutions for each monitors, and it seems to be working fine, but using this method, it's impossible to know what entry is the primary monitor.

After discussing with Sylvain, it seems that the gnome-randr tool we are using on 22.04 is compatible with X, and could be backported to 20.04 to get

- max resolution
- primary monitor

-----

Another thing I'm wondering is... do we really need this complicated test?

We could just extract the max resolution for each screen connected to the device, show that to the tester, and ask them to manually verify (as it's already the case anyway)

Revision history for this message
Pierre Equoy (pieq) wrote :

I proposed a MR that includes a script that should work to determine the information to get the maximum resolution for each connected monitors (using sysfs) as well as the currently selected resolution (using Gtk). If the data do not match, an error is returned:

https://code.launchpad.net/~pieq/plainbox-provider-checkbox/+git/plainbox-provider-checkbox/+merge/424146

I also proposed an additional cleanup MR to remove an unused package from checkbox_support.contrib:

https://code.launchpad.net/~pieq/checkbox-support/+git/checkbox-support/+merge/424147

Changed in plainbox-provider-checkbox:
status: Confirmed → Fix Committed
assignee: nobody → Pierre Equoy (pieq)
Pierre Equoy (pieq)
tags: added: ce-qa-concern
Revision history for this message
PeiYao Chang (baconyao) wrote :

Verify passed
- SKU: TRBA-DVT2-C5
- Windowning Systemd: Wayland
- Manifest: jammy-amd64-20220425-25+jellyfish-tentacool+X19
- iGPU

- SKU: CB16P-DVT2-C3
- Windowning Systemd: X11
- Manifest: jammy-amd64-20220425-33+jellyfish-minccino+X11
- dGPU: NVDIA

Checkbox info:
- checkbox-ng: 1.18.0rc1
- checkbox-support: 0.55.0rc1
- certification-client: 0.50.0rc1
- plainbox-provider-checkbox: 0.65.0rc1
- plainbox-provider-resource-generic: 0.51.0rc1
- plainbox-provider-tpm2: 1.18.0rc1

tags: added: cqa-verified
removed: ce-qa-concern
Changed in plainbox-provider-checkbox:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.