Merge lp:~canonical-platform-qa/ubuntu-system-tests/retry_for_restart_unity into lp:ubuntu-system-tests

Proposed by Sergio Cazzolato
Status: Work in progress
Proposed branch: lp:~canonical-platform-qa/ubuntu-system-tests/retry_for_restart_unity
Merge into: lp:ubuntu-system-tests
Diff against target: 22 lines (+4/-1)
1 file modified
ubuntu_system_tests/tests/base.py (+4/-1)
To merge this branch: bzr merge lp:~canonical-platform-qa/ubuntu-system-tests/retry_for_restart_unity
Reviewer Review Type Date Requested Status
platform-qa-bot continuous-integration Needs Fixing
Brendan Donegan (community) Approve
PS Jenkins bot continuous-integration Approve
prod-platform-qa continuous-integration Pending
Sergio Cazzolato Pending
Review via email: mp+262750@code.launchpad.net

Commit message

Adding retry to the restart_unity method to avoid a test case fail when the unity8 job does not start successfully and the pid cannot be retrieved

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

This seems to work well, it even triggered in one case during the run I just did and saved the test case from failing!

review: Approve
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)

Unmerged revisions

142. By Sergio Cazzolato

Adding retry to the restart_unity8 method

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntu_system_tests/tests/base.py'
2--- ubuntu_system_tests/tests/base.py 2015-06-23 12:48:43 +0000
3+++ ubuntu_system_tests/tests/base.py 2015-06-23 16:09:08 +0000
4@@ -53,7 +53,6 @@
5 super().tearDownClass()
6 unity8.ensure_unity_running_and_greeter_hidden()
7
8- @autopilot_logging.log_action(logger.info)
9 def launch_unity(self):
10 """Launch Unity8 with testability enabled.
11
12@@ -81,6 +80,10 @@
13 )
14 return unity
15
16+ @retry(stop_max_attempt_number=3,
17+ retry_on_exception=
18+ lambda exception: isinstance(exception, psutil.NoSuchProcess))
19+ @autopilot_logging.log_action(logger.info)
20 def restart_unity(self):
21 """Restart and unlock unity8"""
22 unity8.ensure_unity_stopped()

Subscribers

People subscribed via source and target branches

to all changes: