Merge lp:~mbp/launchpad/mbp-trivial into lp:launchpad

Proposed by Martin Pool
Status: Merged
Approved by: Michael Hudson-Doyle
Approved revision: no longer in the source branch.
Merged at revision: 11635
Proposed branch: lp:~mbp/launchpad/mbp-trivial
Merge into: lp:launchpad
Diff against target: 46 lines (+20/-3)
1 file modified
test_on_merge.py (+20/-3)
To merge this branch: bzr merge lp:~mbp/launchpad/mbp-trivial
Reviewer Review Type Date Requested Status
Michael Hudson-Doyle Approve
Review via email: mp+36515@code.launchpad.net

Commit message

handle EINTR in test_on_merge so resizing the window doesn't crash your test run

Description of the change

To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Looks fine, thanks for making the comment clearer.

review: Approve
Revision history for this message
Martin Pool (mbp) wrote :

It fails like so:

Tests with errors
-----------------
 lp.code.windmill.tests.test_branch_subscriptions.TestBranchSubscriptions.test_branch_subscription_ajax_load
 lp.codehosting.puller.tests.test_worker.TestWorkerProgressReporting.test_network

======================================================================
ERROR: lp.code.windmill.tests.test_branch_subscriptions.TestBranchSubscriptions.test_branch_subscription_ajax_load (subunit.RemotedTestCase)
----------------------------------------------------------------------
_StringException: Text attachment: garbage
------------
[<Thread(Thread-631, started daemon 47931595147024)>]
------------

======================================================================
ERROR: lp.codehosting.puller.tests.test_worker.TestWorkerProgressReporting.test_network (subunit.RemotedTestCase)
----------------------------------------------------------------------
_StringException: Text attachment: garbage
------------
[<Thread(Thread-18, started daemon 47106544203536)>]
------------

**NOT** submitted to PQM:
[r=mwhudson][ui=none][bug=615740] handle EINTR in test_on_merge so resizing the window doesn't crash your test run

I guess this is not my fault, but I don't know.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

The branch passed on EC2 a second time, but then failed to land due to testfix mode. Can you land this yourself?

Revision history for this message
Martin Pool (mbp) wrote :

On 25 September 2010 07:26, Michael Hudson-Doyle
<email address hidden> wrote:
> The branch passed on EC2 a second time, but then failed to land due to testfix mode.  Can you land this yourself?

All my previous attempts have been rejected, but I can see about
having pqm access.

--
Martin

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'test_on_merge.py'
--- test_on_merge.py 2010-08-10 21:27:56 +0000
+++ test_on_merge.py 2010-09-23 23:57:49 +0000
@@ -1,6 +1,6 @@
1#!/usr/bin/python -S1#!/usr/bin/python -S
2#2#
3# Copyright 2009 Canonical Ltd. This software is licensed under the3# Copyright 2009, 2010 Canonical Ltd. This software is licensed under the
4# GNU Affero General Public License version 3 (see the file LICENSE).4# GNU Affero General Public License version 3 (see the file LICENSE).
55
6"""Tests that get run automatically on a merge."""6"""Tests that get run automatically on a merge."""
@@ -13,7 +13,7 @@
13import psycopg213import psycopg2
14from subprocess import Popen, PIPE, STDOUT14from subprocess import Popen, PIPE, STDOUT
15from signal import SIGKILL, SIGTERM, SIGINT, SIGHUP15from signal import SIGKILL, SIGTERM, SIGINT, SIGHUP
16from select import select16import select
1717
1818
19# The TIMEOUT setting (expressed in seconds) affects how long a test will run19# The TIMEOUT setting (expressed in seconds) affects how long a test will run
@@ -164,7 +164,24 @@
164 # Popen.communicate() with large data sets.164 # Popen.communicate() with large data sets.
165 open_readers = set([xvfb_proc.stdout])165 open_readers = set([xvfb_proc.stdout])
166 while open_readers:166 while open_readers:
167 rlist, wlist, xlist = select(open_readers, [], [], TIMEOUT)167 # select() blocks for a long time and can easily fail with EINTR
168 # <https://bugs.launchpad.net/launchpad/+bug/615740>. Really we
169 # should have EINTR protection across the whole script (other syscalls
170 # might be interrupted) but this is the longest and most likely to
171 # hit, and doing it perfectly in python has proved to be quite hard in
172 # bzr. -- mbp 20100924
173 while True:
174 try:
175 rlist, wlist, xlist = select.select(open_readers, [], [], TIMEOUT)
176 break
177 except select.error, e:
178 # nb: select.error doesn't expose a named 'errno' attribute,
179 # at least in python 2.6.5; see
180 # <http://mail.python.org/pipermail/python-dev/2000-October/009671.html>
181 if e[0] == errno.EINTR:
182 continue
183 else:
184 raise
168185
169 if len(rlist) == 0:186 if len(rlist) == 0:
170 # The select() statement timed out!187 # The select() statement timed out!