Merge lp:~thomir-deactivatedaccount/autopilot/fix-qt-killing-slowness into lp:autopilot

Proposed by Thomi Richards
Status: Merged
Approved by: Christopher Lee
Approved revision: 181
Merged at revision: 184
Proposed branch: lp:~thomir-deactivatedaccount/autopilot/fix-qt-killing-slowness
Merge into: lp:autopilot
Diff against target: 22 lines (+4/-3)
1 file modified
autopilot/testcase.py (+4/-3)
To merge this branch: bzr merge lp:~thomir-deactivatedaccount/autopilot/fix-qt-killing-slowness
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Christopher Lee (community) Approve
Review via email: mp+161901@code.launchpad.net

Commit message

Make sure applications are closed quickly.

Description of the change

This branch fixes the code that closes launched test applications. Previously they were taking a long time to close.

To post a comment you must log in.
181. By Thomi Richards

remove comments.

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

Looks good.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'autopilot/testcase.py'
2--- autopilot/testcase.py 2013-04-30 17:05:03 +0000
3+++ autopilot/testcase.py 2013-05-01 17:53:27 +0000
4@@ -352,14 +352,15 @@
5 return get_application_launcher(app_path)
6
7 def _kill_process_and_attach_logs(self, process):
8- process.kill()
9+ os.killpg(process.pid, signal.SIGTERM)
10 logger.info("waiting for process to exit.")
11 for i in range(10):
12+ process.poll()
13 if process.returncode is not None:
14 break
15 if i == 9:
16- logger.info("Terminating process group, since it hasn't exited after 10 seconds.")
17- os.killpg(process.pid, signal.SIGTERM)
18+ logger.info("Killing process group, since it hasn't exited after 10 seconds.")
19+ os.killpg(process.pid, signal.SIGKILL)
20 sleep(1)
21 stdout, stderr = process.communicate()
22 self.addDetail('process-stdout', text_content(stdout))

Subscribers

People subscribed via source and target branches