From abb58ee3b84aae63de009a674bc9ce29bdf0c0d3 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 19 Feb 2014 11:11:10 +0100 Subject: [PATCH] [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 --- openerp/tests/common.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/openerp/tests/common.py b/openerp/tests/common.py index e4183ed0392..70412067f6e 100644 --- a/openerp/tests/common.py +++ b/openerp/tests/common.py @@ -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: