From ea9ac508ac3d6084ce6e0ebd8ddaa211503b176c Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Sat, 18 Apr 2020 14:54:48 -0700 Subject: [PATCH] Fix check_desktop variable timeouts I forgot that tries was configurable. Sigh. Convert it to a timeout argument. Signed-off-by: Adam Williamson --- lib/utils.pm | 6 +++++- tests/_graphical_wait_login.pm | 2 +- tests/desktop_notifications.pm | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/utils.pm b/lib/utils.pm index 21de05a3..8f25349f 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -738,7 +738,11 @@ sub check_desktop { # icon. But GNOME has gone back to the top bar being a solid color # by default, so we don't have this problem any more and this is # back to just being a simple needle match. - assert_screen "apps_menu_button", 30; + my %args = ( + timeout => 30, + @_ + ); + assert_screen "apps_menu_button", $args{timeout}; } sub download_modularity_tests { diff --git a/tests/_graphical_wait_login.pm b/tests/_graphical_wait_login.pm index e87f5861..249bee95 100644 --- a/tests/_graphical_wait_login.pm +++ b/tests/_graphical_wait_login.pm @@ -91,7 +91,7 @@ sub run { # Move the mouse somewhere it won't highlight the match areas mouse_set(300, 800); # KDE can take ages to start up - check_desktop(tries=>40); + check_desktop(timeout=>120); } sub test_flags { diff --git a/tests/desktop_notifications.pm b/tests/desktop_notifications.pm index 31126739..42754aab 100644 --- a/tests/desktop_notifications.pm +++ b/tests/desktop_notifications.pm @@ -67,7 +67,7 @@ sub run { type_very_safely get_var("USER_PASSWORD", "weakpassword"); send_key 'ret'; } - check_desktop(tries=>30); + check_desktop(timeout=>90); # now, WE WAIT. this is just an unconditional wait - rather than # breaking if we see an update notification appear - so we catch # things that crash a few minutes after startup, etc.