Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade eventlet to the latest version (0.22.1) #4007

Merged
merged 10 commits into from
Feb 22, 2018
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@ Changed
packages. Also add support for multiple runners (runner modules) inside a single Python package
and consolidate Python packages from two to one for the following runners: local runners, remote
runners, windows runners. (improvement) #3999
* Upgrade eventlet library to the latest stable version (0.22.1) (improvement) #4007

Fixed
~~~~~
3 changes: 3 additions & 0 deletions contrib/packs/tests/test_action_download.py
Original file line number Diff line number Diff line change
@@ -21,6 +21,9 @@
import tempfile
import hashlib

from st2common.util.monkey_patch import use_select_poll_workaround
use_select_poll_workaround()

from lockfile import LockFile
from lockfile import LockTimeout
from git.repo import Repo
3 changes: 3 additions & 0 deletions contrib/packs/tests/test_action_unload.py
Original file line number Diff line number Diff line change
@@ -19,6 +19,9 @@

from oslo_config import cfg

from st2common.util.monkey_patch import use_select_poll_workaround
use_select_poll_workaround()

from st2common.content.bootstrap import register_content
from st2common.persistence.pack import Pack
from st2common.persistence.pack import Config
2 changes: 1 addition & 1 deletion fixed-requirements.txt
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
greenlet==0.4.12
# Note: 0.20.0 removed select.poll() on which some of our code and libraries we
# depend on rely
eventlet==0.19.0
eventlet==0.22.1
gunicorn==19.7.1
kombu==4.1.0
# Note: amqp is used by kombu
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
apscheduler==3.4.0
argcomplete
bcrypt
eventlet==0.19.0
eventlet==0.22.1
flex==6.11.1
git+https://github.com/Kami/logshipper.git@stackstorm_patched#egg=logshipper
git+https://github.com/StackStorm/python-mistralclient.git#egg=python-mistralclient
16 changes: 16 additions & 0 deletions st2common/st2common/util/monkey_patch.py
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@

__all__ = [
'monkey_patch',
'use_select_poll_workaround',
'is_use_debugger_flag_provided'
]

@@ -44,6 +45,21 @@ def monkey_patch():
eventlet.monkey_patch(os=True, select=True, socket=True, thread=patch_thread, time=True)


def use_select_poll_workaround():
"""
Work around for some tests which injects original select module with select.poll()
available to sys.modules.
"""
import sys
import subprocess
import eventlet

# Work around to get tests to pass with eventlet >= 0.20.0
if 'nose' in sys.modules.keys():
sys.modules['select'] = eventlet.patcher.original('select')
subprocess.select = eventlet.patcher.original('select')


def is_use_debugger_flag_provided():
# 1. Check sys.argv directly
if USE_DEBUGGER_FLAG in sys.argv:
8 changes: 8 additions & 0 deletions st2common/tests/unit/test_pack_management.py
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@
# limitations under the License.

from __future__ import absolute_import

import os
import sys

@@ -25,8 +26,15 @@

sys.path.insert(0, PACK_ACTIONS_DIR)

from st2common.util.monkey_patch import use_select_poll_workaround
use_select_poll_workaround()

from pack_mgmt.download import DownloadGitRepoAction

__all__ = [
'InstallPackTestCase'
]


class InstallPackTestCase(unittest2.TestCase):