Comment 2 for bug 1079460

Revision history for this message
Francis Ginther (fginther) wrote :

I believe this is the root cause of a large number of autopilot failures when run via the ssh method (when there are no windows open on the unity desktop). The failures have stack traces similar to this:
Traceback (most recent call last):
  File "/home/fginther/work/unity/unity/tests/autopilot/unity/tests/__init__.py", line 109, in check_test_behavior
    self.window_manager.leave_show_desktop()
  File "/home/fginther/work/unity/unity/tests/autopilot/unity/emulators/window_manager.py", line 46, in leave_show_desktop
    self.showdesktop_active.wait_for(False)
  File "/usr/lib/python2.7/dist-packages/autopilot/introspection/dbus.py", line 172, in wait_for
    % (self.parent.__class__.__name__, self.name, failure_msg))
AssertionError: After 10 seconds test on WindowManager.showdesktop_active failed: False != dbus.Boolean(True, variant_level=1)

The log will also show:
13:07:42.891 INFO __init__:83 - Checking system state for badly behaving test...
13:07:53.501 WARNING __init__:108 - Test left the system in show desktop mode, e
xiting it...
13:07:53.580 INFO window_manager:41 - Leaving show desktop mode.
13:07:53.581 DEBUG X11:125 - Pressing keys 'Ctrl+Super+d' with delay 0.200000
13:07:53.581 DEBUG X11:212 - Sending press event for key: Control_L
13:07:53.783 DEBUG X11:212 - Sending press event for key: Super_L
13:07:53.985 DEBUG X11:212 - Sending press event for key: d
13:07:54.187 DEBUG X11:144 - Releasing keys 'Ctrl+Super+d' with delay 0.200000
13:07:54.188 DEBUG X11:215 - Sending release event for key: d
13:07:54.390 DEBUG X11:215 - Sending release event for key: Super_L
13:07:54.593 DEBUG X11:215 - Sending release event for key: Control_L

The general problem is that autopilot checks the state of showdesktop at the end of each test and attempts to leave it if it is set. As this can't be done when there are no windows open, there is a chance of this failure at the end of each test.