Merge lp:~fginther/unity/autopilot-showdesktop-cleanup into lp:unity

Proposed by Francis Ginther
Status: Merged
Approved by: Francis Ginther
Approved revision: no longer in the source branch.
Merged at revision: 2911
Proposed branch: lp:~fginther/unity/autopilot-showdesktop-cleanup
Merge into: lp:unity
Diff against target: 36 lines (+18/-1)
1 file modified
tests/autopilot/unity/tests/__init__.py (+18/-1)
To merge this branch: bzr merge lp:~fginther/unity/autopilot-showdesktop-cleanup
Reviewer Review Type Date Requested Status
Martin Mrazik (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Timo Jyrinki Approve
Review via email: mp+134756@code.launchpad.net

Commit message

Open a temporary app window to always allow exit from showdesktop_active mode.

If there are no application windows open, showdesktop_active can be set, but not cleared. This provides a hackish solution that will get unity back into the desired state for the next test. It does not solve the problem of a test attempting to leave showdesktop_active mode under these conditions.

Description of the change

Open a temporary app window to always allow exit from showdesktop_active mode.

If there are no application windows open, showdesktop_active can be set, but not cleared. This provides a hackish solution that will get unity back into the desired state for the next test. It does not solve the problem of a test attempting to leave showdesktop_active mode under these conditions.

Testing:
Before this change, I would see nearly 300 of the 464 tests fail with message "Test left the system in show desktop mode, exiting it...". After this change, I only saw one of these failures. Total failures went from 312 to 116. Testing was done on a virtual-box vm running unity 6.10.0bzr2895pkg0quantal0.

To post a comment you must log in.
Revision history for this message
Martin Mrazik (mrazik) wrote :

Just two technical notes:
1. The linking to the bug is unfortunate. If this gets approved and merged the bug will be marked as "Fix Committed" which is not going to be the case. This branch is just a workaround for the bug and not a real fix.

2. If we don't want to get this into trunk (as it is just a workaround) maybe it can be maintained as a distro patch (which makes sense as the patch is indeed primarily for us being able to release unity continuously in ubuntu). The other option (implemented right now) is the utah-jenkins branch. Unfortunately if the patch doesn't merge cleanly we will only notice too late.

Francis, the Needs Fixing is for #1 from my POV (you can add the link to the bugreport into description). I leave the #2 for the others.

review: Needs Fixing
Revision history for this message
Martin Mrazik (mrazik) wrote :

and btw. if you have used something like "bzr commit --fixes" then it needs to go away as well (too lazy to check).

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

I'm answering on #2:
We don't want distro patch. It's an easy answer for putting all the hacks outside of trunk and put that in the distro. Please either fix it properly, with normal tests, or take the responsibility of the workaround and put it in trunk.

We don't want the unity stack and ubuntu to diverge more than all the distro patches we already have in compiz.

Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

IMHO a reasonable workaround for now. Remove the bug link to 1079460.

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

> Just two technical notes:
> 1. The linking to the bug is unfortunate. If this gets approved and merged the
> bug will be marked as "Fix Committed" which is not going to be the case. This
> branch is just a workaround for the bug and not a real fix.
>
> Francis, the Needs Fixing is for #1 from my POV (you can add the link to the
> bugreport into description). I leave the #2 for the others.

Uploaded the branch after removing the linked bug.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Martin Mrazik (mrazik) :
review: Approve
Revision history for this message
Francis Ginther (fginther) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/unity/tests/__init__.py'
2--- tests/autopilot/unity/tests/__init__.py 2012-11-16 16:54:25 +0000
3+++ tests/autopilot/unity/tests/__init__.py 2012-11-19 14:22:23 +0000
4@@ -19,6 +19,7 @@
5 import os
6 import sys
7 from tempfile import mktemp
8+from time import sleep
9 try:
10 import testapp
11 import json
12@@ -106,7 +107,23 @@
13 well_behaved = False
14 reasons.append("The test left the system in show_desktop mode.")
15 log.warning("Test left the system in show desktop mode, exiting it...")
16- self.window_manager.leave_show_desktop()
17+ # It is not possible to leave show desktop mode if there are no
18+ # app windows. So, just open a window and perform the show
19+ # desktop action until the desired state is acheived, then close
20+ # the window. The showdesktop_active state will persist.
21+ #
22+ # In the event that this doesn't work, wait_for will throw an
23+ # exception.
24+ win = self.start_app_window('Calculator', locale='C')
25+ count = 1
26+ while self.window_manager.showdesktop_active:
27+ self.keybinding("window/show_desktop")
28+ sleep(count)
29+ count+=1
30+ if count > 10:
31+ break
32+ win.close()
33+ self.window_manager.showdesktop_active.wait_for(False)
34 for launcher in self.launcher.get_launchers():
35 if not self.well_behaved(launcher, in_keynav_mode=False):
36 well_behaved = False