Merge lp:~sil2100/unity/autopilot_disable_screen_lock into lp:unity

Proposed by Łukasz Zemczak
Status: Merged
Approved by: Christopher Lee
Approved revision: no longer in the source branch.
Merged at revision: 3307
Proposed branch: lp:~sil2100/unity/autopilot_disable_screen_lock
Merge into: lp:unity
Diff against target: 23 lines (+7/-0)
1 file modified
tests/autopilot/unity/tests/__init__.py (+7/-0)
To merge this branch: bzr merge lp:~sil2100/unity/autopilot_disable_screen_lock
Reviewer Review Type Date Requested Status
Christopher Lee (community) Approve
Didier Roche-Tolomelli Approve
PS Jenkins bot (community) continuous-integration Approve
Michael Terry Needs Fixing
Review via email: mp+158989@code.launchpad.net

Commit message

Disable screen locking during autopilot test runs

Description of the change

- Problem:

Sometimes when an autopilot test runs, the screen gets locked and we get failures on jenkins.

- Fix:

Disable screen locking through gsettings on every test start and re-enable it back again in the end.

- Tests:

N/A
(But maybe we should add one ;) ? )

To post a comment you must log in.
Revision history for this message
Michael Terry (mterry) wrote :

Idea seems great, thanks for it.

But we should restore original value rather than always cleaning up with True.

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Right, where was my head when I was writing this. Fixing!

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

the gsettings part looks fine, not sure where it should be in the autopilot part though, so we need an autopilot expert for the finale ack.

review: Approve
Revision history for this message
Christopher Lee (veebers) wrote :

Cool, looks like a good stopgap measure until we figure out why we sometimes have tests fail really hard :-)

review: Approve

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 2013-04-09 18:37:33 +0000
3+++ tests/autopilot/unity/tests/__init__.py 2013-04-15 22:43:30 +0000
4@@ -43,6 +43,7 @@
5 from Xlib import display
6 from Xlib import Xutil
7
8+from gi.repository import Gio
9
10 log = getLogger(__name__)
11
12@@ -66,6 +67,12 @@
13 # ropey. Once it's been proven to work reliably we can remove this line:
14 self.set_unity_log_level("unity.wm.compiz", "DEBUG")
15
16+ # For the length of the test, disable screen locking
17+ self._desktop_settings = Gio.Settings.new("org.gnome.desktop.lockdown")
18+ lock_state = self._desktop_settings.get_boolean("disable-lock-screen")
19+ self._desktop_settings.set_boolean("disable-lock-screen", True)
20+ self.addCleanup(self._desktop_settings.set_boolean, "disable-lock-screen", lock_state)
21+
22 def check_test_behavior(self):
23 """Fail the test if it did something naughty.
24