Fix tests in the stable branches
The stable maintenance tests are run using the current CI images
(appropriately enough, since that's the environment a stable branch
is likely to be deployed in). In any case, there have been some
distro changes affecting py27 reflected in the current images and
the tests are failing [0].
This patch includes two changes:
- eventlet issue <0.22.0 (impacts functional tests)
(cherry picked from commit 6f63d28d9b
)
- fixtures must be imported absolutely or they aren't monkey patched
(change could not be cherry-picked from master because some other
refactoring occurred that would make for a non-trivial backport, and
it's not worth the risk)
[0] http://lists.openstack.org/pipermail/openstack-stable-maint/2018-February/007235.html
Co-authored by: Erno Kuvaja <jokke@usr.fi>
Co-authored by: Brian Rosmaita <rosmaita.fossdev@gmail.com>
Closes-bug: #1747304
Change-Id: Ib9f8a52136e25d1cb609d465ca5d859523d9acc6
This commit is contained in:
parent
06af2eb5ab
commit
3a638140ca
|
@ -29,6 +29,12 @@ from oslo_utils import encodeutils
|
|||
|
||||
|
||||
# Monkey patch socket, time, select, threads
|
||||
# NOTE(jokke): As per the eventlet commit
|
||||
# b756447bab51046dfc6f1e0e299cc997ab343701 there's circular import happening
|
||||
# which can be solved making sure the hubs are properly and fully imported
|
||||
# before calling monkey_patch(). This is solved in eventlet 0.22.0 but we
|
||||
# need to address it before that is widely used around.
|
||||
eventlet.hubs.get_hub()
|
||||
eventlet.patcher.monkey_patch(all=False, socket=True, time=True,
|
||||
select=True, thread=True, os=True)
|
||||
|
||||
|
|
|
@ -28,6 +28,12 @@ import eventlet
|
|||
from oslo_utils import encodeutils
|
||||
|
||||
# Monkey patch socket and time
|
||||
# NOTE(jokke): As per the eventlet commit
|
||||
# b756447bab51046dfc6f1e0e299cc997ab343701 there's circular import happening
|
||||
# which can be solved making sure the hubs are properly and fully imported
|
||||
# before calling monkey_patch(). This is solved in eventlet 0.22.0 but we
|
||||
# need to address it before that is widely used around.
|
||||
eventlet.hubs.get_hub()
|
||||
eventlet.patcher.monkey_patch(all=False, socket=True, time=True, thread=True)
|
||||
|
||||
# If ../glance/__init__.py exists, add ../ to Python search path, so that
|
||||
|
|
|
@ -38,6 +38,12 @@ from oslo_log import log as logging
|
|||
from glance.common import config
|
||||
from glance import scrubber
|
||||
|
||||
# NOTE(jokke): As per the eventlet commit
|
||||
# b756447bab51046dfc6f1e0e299cc997ab343701 there's circular import happening
|
||||
# which can be solved making sure the hubs are properly and fully imported
|
||||
# before calling monkey_patch(). This is solved in eventlet 0.22.0 but we
|
||||
# need to address it before that is widely used around.
|
||||
eventlet.hubs.get_hub()
|
||||
eventlet.patcher.monkey_patch(all=False, socket=True, time=True, select=True,
|
||||
thread=True, os=True)
|
||||
|
||||
|
|
|
@ -28,4 +28,10 @@ logger.addHandler(hdlr)
|
|||
logger.setLevel(logging.DEBUG)
|
||||
|
||||
import eventlet
|
||||
# NOTE(jokke): As per the eventlet commit
|
||||
# b756447bab51046dfc6f1e0e299cc997ab343701 there's circular import happening
|
||||
# which can be solved making sure the hubs are properly and fully imported
|
||||
# before calling monkey_patch(). This is solved in eventlet 0.22.0 but we
|
||||
# need to address it before that is widely used around.
|
||||
eventlet.hubs.get_hub()
|
||||
eventlet.patcher.monkey_patch()
|
||||
|
|
|
@ -21,6 +21,10 @@ and Registry server, grabbing the logs of each, cleaning up pidfiles,
|
|||
and spinning down the servers.
|
||||
"""
|
||||
|
||||
# NOTE(rosmaita): mriedem says this is needed for importing from fixtures,
|
||||
# and he's right!
|
||||
from __future__ import absolute_import
|
||||
|
||||
import atexit
|
||||
import datetime
|
||||
import errno
|
||||
|
|
|
@ -10,6 +10,10 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
# NOTE(rosmaita): mriedem says this is needed for importing from fixtures,
|
||||
# and he's right!
|
||||
from __future__ import absolute_import
|
||||
|
||||
import atexit
|
||||
import os.path
|
||||
import tempfile
|
||||
|
|
|
@ -13,6 +13,10 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
# NOTE(rosmaita): mriedem says this is needed for importing from fixtures,
|
||||
# and he's right!
|
||||
from __future__ import absolute_import
|
||||
|
||||
import atexit
|
||||
import os.path
|
||||
import tempfile
|
||||
|
|
|
@ -13,6 +13,10 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
# NOTE(rosmaita): mriedem says this is needed for importing from fixtures,
|
||||
# and he's right!
|
||||
from __future__ import absolute_import
|
||||
|
||||
import os.path
|
||||
import shutil
|
||||
|
||||
|
|
|
@ -12,6 +12,10 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
# NOTE(rosmaita): mriedem says this is needed for importing from fixtures,
|
||||
# and he's right!
|
||||
from __future__ import absolute_import
|
||||
|
||||
import fixtures
|
||||
|
||||
from glance.common import exception
|
||||
|
|
|
@ -15,6 +15,10 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
# NOTE(rosmaita): mriedem says this is needed for importing from fixtures,
|
||||
# and he's right!
|
||||
from __future__ import absolute_import
|
||||
|
||||
import datetime
|
||||
import gettext
|
||||
import os
|
||||
|
|
|
@ -12,6 +12,10 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
# NOTE(rosmaita): mriedem says this is needed for importing from fixtures,
|
||||
# and he's right!
|
||||
from __future__ import absolute_import
|
||||
|
||||
import copy
|
||||
import os
|
||||
import sys
|
||||
|
|
|
@ -13,6 +13,10 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
# NOTE(rosmaita): mriedem says this is needed for importing from fixtures,
|
||||
# and he's right!
|
||||
from __future__ import absolute_import
|
||||
|
||||
from contextlib import contextmanager
|
||||
import datetime
|
||||
import hashlib
|
||||
|
|
|
@ -13,6 +13,10 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
# NOTE(rosmaita): mriedem says this is needed for importing from fixtures,
|
||||
# and he's right!
|
||||
from __future__ import absolute_import
|
||||
|
||||
import fixtures
|
||||
import mock
|
||||
|
||||
|
|
|
@ -15,6 +15,10 @@
|
|||
|
||||
"""Common utilities used in testing"""
|
||||
|
||||
# NOTE(rosmaita): mriedem says this is needed for importing from fixtures,
|
||||
# and he's right!
|
||||
from __future__ import absolute_import
|
||||
|
||||
import errno
|
||||
import functools
|
||||
import os
|
||||
|
|
Loading…
Reference in New Issue