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
=== modified file 'autopilot/testcase.py'
--- autopilot/testcase.py 2013-04-30 17:05:03 +0000
+++ autopilot/testcase.py 2013-05-01 17:53:27 +0000
@@ -352,14 +352,15 @@
352 return get_application_launcher(app_path)352 return get_application_launcher(app_path)
353353
354 def _kill_process_and_attach_logs(self, process):354 def _kill_process_and_attach_logs(self, process):
355 process.kill()355 os.killpg(process.pid, signal.SIGTERM)
356 logger.info("waiting for process to exit.")356 logger.info("waiting for process to exit.")
357 for i in range(10):357 for i in range(10):
358 process.poll()
358 if process.returncode is not None:359 if process.returncode is not None:
359 break360 break
360 if i == 9:361 if i == 9:
361 logger.info("Terminating process group, since it hasn't exited after 10 seconds.")362 logger.info("Killing process group, since it hasn't exited after 10 seconds.")
362 os.killpg(process.pid, signal.SIGTERM)363 os.killpg(process.pid, signal.SIGKILL)
363 sleep(1)364 sleep(1)
364 stdout, stderr = process.communicate()365 stdout, stderr = process.communicate()
365 self.addDetail('process-stdout', text_content(stdout))366 self.addDetail('process-stdout', text_content(stdout))

Subscribers

People subscribed via source and target branches