eventlet workaround to avoid import cycle issue

Do get_hub() before monkey_patch() to workaround issue with
import cycles in eventlet < 0.22.0;
Based on the worked-around in eventlet with patch
b756447bab

Also reverts the test skipping that was done because of the issue.

Revert "temporarily skip local haht test under py27"
This reverts commit de2e4f1cfc.

Closes-Bug: 1746136
Closes-Bug: 1745112

Change-Id: I72c349e81dfc02136b22637c707ad4908c9f269e
This commit is contained in:
Eric Kao 2018-01-23 03:34:02 +00:00 committed by Eric K
parent 32549af4c6
commit 837f4ce431
4 changed files with 18 additions and 5 deletions

View File

@ -1,3 +1,9 @@
# NOTE(ekcs): monkey_patch upfront to ensure all imports get patched modules
import eventlet
# NOTE(ekcs): get_hub() before monkey_patch() to workaround issue with
# import cycles in eventlet < 0.22.0;
# Based on the worked-around in eventlet with patch
# https://github.com/eventlet/eventlet/commit/b756447bab51046dfc6f1e0e299cc997ab343701
# For details please check https://bugs.launchpad.net/congress/+bug/1746136
eventlet.hubs.get_hub()
eventlet.monkey_patch()

View File

@ -1,3 +1,9 @@
# NOTE(ekcs): monkey_patch upfront to ensure all imports get patched modules
import eventlet
# NOTE(ekcs): get_hub() before monkey_patch() to workaround issue with
# import cycles in eventlet < 0.22.0;
# Based on the worked-around in eventlet with patch
# https://github.com/eventlet/eventlet/commit/b756447bab51046dfc6f1e0e299cc997ab343701
# For details please check https://bugs.launchpad.net/congress/+bug/1746136
eventlet.hubs.get_hub()
eventlet.monkey_patch()

View File

@ -1,3 +1,9 @@
# NOTE(boden): patch upfront to ensure all imports get patched modules
import eventlet
# NOTE(ekcs): get_hub() before monkey_patch() to workaround issue with
# import cycles in eventlet < 0.22.0;
# Based on the worked-around in eventlet with patch
# https://github.com/eventlet/eventlet/commit/b756447bab51046dfc6f1e0e299cc997ab343701
# For details please check https://bugs.launchpad.net/congress/+bug/1746136
eventlet.hubs.get_hub()
eventlet.monkey_patch()

View File

@ -31,7 +31,6 @@ import time
from oslo_log import log as logging
import requests
import six
import tenacity
from congress.db import api as db
@ -71,10 +70,6 @@ class TestCongressHAHT(base.SqlTestCase):
return x
def setUp(self):
# FIXME(ekcs): fix test and unskip
if six.PY2:
self.skipTest("Temporarily skip under python 2 while "
"failure is being resolved.")
super(TestCongressHAHT, self).setUp()
assert sys.executable is not None,\
'test cannot proceed when sys.executable is None'