test_on_merge.py doesn't handle eintr
Bug #615740 reported by
Martin Pool
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
Medium
|
Martin Pool |
Bug Description
If you resize a window while 'make check' is running, you get
test_scriptnot
canonical.
File "./test_
sys.
File "./test_
rlist, wlist, xlist = select(
select.error: (4, 'Interrupted system call')
make: *** [check] Error 1
make check 151.96s user 41.28s system 33% cpu 9:42.08 total
sigh
summary: |
- test_on_merge.py doesn't handle eintry + test_on_merge.py doesn't handle eintr |
affects: | launchpad → launchpad-foundations |
Changed in launchpad-foundations: | |
assignee: | nobody → Martin Pool (mbp) |
importance: | Undecided → Medium |
status: | New → In Progress |
tags: |
added: qa-untestable removed: qa-needstesting |
Changed in launchpad-foundations: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Proposed fix:
=== modified file 'test_on_merge.py'
--- test_on_merge.py 2010-07-28 14:28:57 +0000
+++ test_on_merge.py 2010-08-10 07:53:34 +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 open_readers, [], [], TIMEOUT) /bugs.launchpad .net/launchpad/ +bug/615740> - catching select( open_readers, [], [], TIMEOUT)
# before it is deemed to be hung, and then appropriately terminated.
@@ -155,7 +155,18 @@
# stderr for too long.
open_readers = set([proc.stdout])
while open_readers:
- rlist, wlist, xlist = select(
+ # blocks for a long time and can easily fail with EINTR
+ # <https:/
+ # it just here is not very useful but is pragmatic
+ while True
+ try:
+ rlist, wlist, xlist = select.
+ break
+ except select.error, e:
+ if e.errno == errno.EINTR:
+ continue
+ else:
+ raise
if len(rlist) == 0:
if proc.poll() is not None: