desktop_switch_layout: give switching 3 tries to work

There's a fairly longstanding issue in GDM where switching layout
just doesn't work sometimes:
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6066#note_1707051
there doesn't seem to be any progress on getting this fixed, and
it's annoying constantly restarting tests that fail on it. So
this just makes us try three times to switch before giving up.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2023-04-01 14:55:27 -07:00
parent 278b1e32b0
commit 47664b0dd8
1 changed files with 4 additions and 2 deletions

View File

@ -119,8 +119,10 @@ sub desktop_switch_layout {
my $switcher = "alt-shift"; # anaconda
$switcher = "super-spc" if $environment eq 'gnome';
# KDE? not used yet
send_key $switcher;
assert_screen "${environment}_layout_${layout}", 3;
# FIXME we use send_key_until_needlematch because sometimes the
# switch just doesn't work in gdm:
# https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6066#note_1707051
send_key_until_needlematch("${environment}_layout_${layout}", $switcher, 3, 3);
}
# this is used at the end of console_login to check if we got a prompt