on xenial help sign in
Retry unlocking the greeter three times.
39186f6Michał Sawicz
tests/autopilot/unity8/process_helpers.py+17−1
@@ -69,7 +69,23 @@ def unlock_unity(unity_proxy_obj=None):
69 greeter = main_window.get_greeter()
69 greeter = main_window.get_greeter()
70 if greeter.created == False:
70 if greeter.created == False:
71 raise RuntimeWarning("Greeter appears to be already unlocked.")
71 raise RuntimeWarning("Greeter appears to be already unlocked.")
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:
72− greeter.swipe()
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
73
89
74
90
75def restart_unity_with_testability(*args):
91def restart_unity_with_testability(*args):