on xenial help sign in
Retry unlocking the greeter three times.

Approved by PS Jenkins bot, Christopher Lee.

commit39186f6af324c3bcff0a5d5d62110016bfad706a authorMichał Sawicz <michal.sawicz@canonical.com> dateThu 12 Dec 2013, 10:14 (13 years ago) parent9d8eac979c4aec
1 file changed+17−1
tests/autopilot/unity8/process_helpers.py+17−1
tests/autopilot/unity8/process_helpers.py+17−1
@@ -69,7 +69,23 @@ def unlock_unity(unity_proxy_obj=None):
6969 greeter = main_window.get_greeter()
7070 if greeter.created == False:
7171 raise RuntimeWarning("Greeter appears to be already unlocked.")
72− greeter.swipe()
72+
73+ # Because of potential input jerkiness under heavy load,
74+ # retry unlocking the greeter two times.
75+ # https://bugs.launchpad.net/ubuntu/+bug/1260113
76+
77+ retries = 3
78+ while retries > 0:
79+ try:
80+ greeter.swipe()
81+ except AssertionError:
82+ retries -= 1
83+ if retries == 0:
84+ raise
85+ logger.info("Failed to unlock greeter, trying again...")
86+ else:
87+ logger.info("Greeter unlocked, continuing.")
88+ break
7389
7490
7591def restart_unity_with_testability(*args):