Fix tests in stable/ocata
Backport fixes due to distro changes affecting py27 causing stable maintenance check jobs to fail. This patch includes the following changes: - Invoke Monkey Patching for All Tests (cherry picked from commit630402204e
) - eventlet issue <0.22.0 (impacts functional tests) - fixtures must be imported absolutely or they aren't monkey patched (these two were cherry picked from commit3a638140ca
) - extending eventlet issue <0.22.0 fix to glare (new in this patch, not required in pike or master) Closes-bug: #1747305 Change-Id: Ib9f8a52136e25d1cb609d465ca5d859523d9acc6
This commit is contained in:
parent
d9ca87d9f7
commit
539c2fab9e
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
# 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)
|
||||||
|
|
||||||
|
|
|
@ -31,3 +31,12 @@ formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
|
||||||
hdlr.setFormatter(formatter)
|
hdlr.setFormatter(formatter)
|
||||||
logger.addHandler(hdlr)
|
logger.addHandler(hdlr)
|
||||||
logger.setLevel(logging.DEBUG)
|
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.
|
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
|
||||||
|
|
|
@ -14,6 +14,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