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
|
# 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,
|
eventlet.patcher.monkey_patch(all=False, socket=True, time=True,
|
||||||
select=True, thread=True, os=True)
|
select=True, thread=True, os=True)
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,12 @@ import eventlet
|
||||||
from oslo_utils import encodeutils
|
from oslo_utils import encodeutils
|
||||||
|
|
||||||
# Monkey patch socket and time
|
# 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)
|
eventlet.patcher.monkey_patch(all=False, socket=True, time=True, thread=True)
|
||||||
|
|
||||||
# If ../glance/__init__.py exists, add ../ to Python search path, so that
|
# 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.common import config
|
||||||
from glance import scrubber
|
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,
|
eventlet.patcher.monkey_patch(all=False, socket=True, time=True, select=True,
|
||||||
thread=True, os=True)
|
thread=True, os=True)
|
||||||
|
|
||||||
|
|
|
@ -28,4 +28,10 @@ logger.addHandler(hdlr)
|
||||||
logger.setLevel(logging.DEBUG)
|
logger.setLevel(logging.DEBUG)
|
||||||
|
|
||||||
import eventlet
|
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()
|
eventlet.patcher.monkey_patch()
|
||||||
|
|
|
@ -21,6 +21,10 @@ and Registry server, grabbing the logs of each, cleaning up pidfiles,
|
||||||
and spinning down the servers.
|
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 atexit
|
||||||
import datetime
|
import datetime
|
||||||
import errno
|
import errno
|
||||||
|
|
|
@ -10,6 +10,10 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# 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 atexit
|
||||||
import os.path
|
import os.path
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
|
@ -13,6 +13,10 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# 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 atexit
|
||||||
import os.path
|
import os.path
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
|
@ -13,6 +13,10 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# 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 os.path
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,10 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# 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 fixtures
|
||||||
|
|
||||||
from glance.common import exception
|
from glance.common import exception
|
||||||
|
|
|
@ -15,6 +15,10 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# 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 datetime
|
||||||
import gettext
|
import gettext
|
||||||
import os
|
import os
|
||||||
|
|
|
@ -12,6 +12,10 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# 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 copy
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
|
@ -13,6 +13,10 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# 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
|
from contextlib import contextmanager
|
||||||
import datetime
|
import datetime
|
||||||
import hashlib
|
import hashlib
|
||||||
|
|
|
@ -13,6 +13,10 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# 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 fixtures
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,10 @@
|
||||||
|
|
||||||
"""Common utilities used in testing"""
|
"""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 errno
|
||||||
import functools
|
import functools
|
||||||
import os
|
import os
|
||||||
|
|
Loading…
Reference in New Issue