[FIX] possibility of select being interrupted, just restart the call

uses EnvironmentError because not sure if socket.error or os.error

bzr revid: xmo@openerp.com-20140219101110-4g4o658vzsol7jae
This commit is contained in:
Xavier Morel 2014-02-19 11:11:10 +01:00
parent 61c82f28a4
commit abb58ee3b8
1 changed files with 7 additions and 4 deletions

View File

@ -4,18 +4,16 @@ The module :mod:`openerp.tests.common` provides unittest2 test cases and a few
helpers and classes to write tests.
"""
import errno
import json
import logging
import os
import select
import subprocess
import sys
import threading
import time
import unittest2
import uuid
import xmlrpclib
import threading
import openerp
@ -197,7 +195,12 @@ class HttpCase(TransactionCase):
"PhantomJS tests should take less than %s seconds" % timeout)
# read a byte
ready, _, _ = select.select([phantom.stdout], [], [], 0.5)
try:
ready, _, _ = select.select([phantom.stdout], [], [], 0.5)
except EnvironmentError, e:
if e.errno == errno.EINTR: continue
raise
if ready:
s = phantom.stdout.read(1)
if s: