← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Martin Pool has proposed merging lp:~mbp/launchpad/mbp-trivial into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  #615708 help for domname contains Launchpad translations metadata?
  https://bugs.launchpad.net/bugs/615708
  #615740 test_on_merge.py doesn't handle eintr
  https://bugs.launchpad.net/bugs/615740


Resizing your window shouldn't break "make check"!  See bug 615740 for more.
-- 
https://code.launchpad.net/~mbp/launchpad/mbp-trivial/+merge/32173
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~mbp/launchpad/mbp-trivial into lp:launchpad.
=== modified file 'test_on_merge.py'
--- test_on_merge.py	2010-07-28 14:28:57 +0000
+++ test_on_merge.py	2010-08-10 08:29:13 +0000
@@ -1,6 +1,6 @@
 #!/usr/bin/python -S
 #
-# Copyright 2009 Canonical Ltd.  This software is licensed under the
+# Copyright 2009, 2010 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 """Tests that get run automatically on a merge."""
@@ -13,7 +13,7 @@
 import psycopg2
 from subprocess import Popen, PIPE, STDOUT
 from signal import SIGKILL, SIGTERM
-from select import select
+import select
 
 # The TIMEOUT setting (expressed in seconds) affects how long a test will run
 # before it is deemed to be hung, and then appropriately terminated.
@@ -155,7 +155,19 @@
     # stderr for too long.
     open_readers = set([proc.stdout])
     while open_readers:
-        rlist, wlist, xlist = select(open_readers, [], [], TIMEOUT)
+        # blocks for a long time and can easily fail with EINTR
+        # <https://bugs.launchpad.net/launchpad/+bug/615740> - catching
+        # it just here is not the perfect fix (other syscalls might be
+        # interrupted) but is pragmatic
+        while True:
+            try:
+                rlist, wlist, xlist = select.select(open_readers, [], [], TIMEOUT)
+                break
+            except select.error, e:
+                if e.errno == errno.EINTR:
+                    continue
+                else:
+                    raise
 
         if len(rlist) == 0:
             if proc.poll() is not None:


Follow ups