Invoke Monkey Patching for All Tests

Eventlet 0.20.x adds support for monkey patching 'subprocess' and
drops 'select.poll'. So, when 'select' is patched and 'subproces'
is not, which is how Glance moneky patches for eventlet, following
errors show up.
"AttributeError: module 'select' has no attribute 'poll'".

Thus, to fix the errors I4de03e2a1ca493cd49a474a67cbbdec24d61b98f
attempted to green the tests to support eventlet 0.20.x.
However, that covered only functional tests causing other tests to
fail. This change monkey patches for eventlet right in 'glance.tests`
pacakge so that all tests are covered.

Closes-Bug: #1655727
Change-Id: Ice3d431ac0c8ece97471abced9ae2d5ad2be261d
This commit is contained in:
Hemanth Makkapati 2017-03-22 10:42:01 -05:00
parent 9de043acb0
commit 630402204e
2 changed files with 3 additions and 3 deletions

View File

@ -26,3 +26,6 @@ formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr)
logger.setLevel(logging.DEBUG)
import eventlet
eventlet.patcher.monkey_patch()

View File

@ -34,7 +34,6 @@ import sys
import tempfile
import time
import eventlet
import fixtures
from oslo_serialization import jsonutils
# NOTE(jokke): simplified transition to py3, behaves like py2 xrange
@ -50,8 +49,6 @@ from glance.tests import utils as test_utils
execute, get_unused_port = test_utils.execute, test_utils.get_unused_port
tracecmd_osmap = {'Linux': 'strace', 'FreeBSD': 'truss'}
eventlet.patcher.monkey_patch()
class Server(object):
"""