diff --git a/oslo_concurrency/tests/__init__.py b/oslo_concurrency/tests/__init__.py index bd455c4..73122fb 100644 --- a/oslo_concurrency/tests/__init__.py +++ b/oslo_concurrency/tests/__init__.py @@ -17,3 +17,9 @@ import os if os.environ.get('TEST_EVENTLET'): import eventlet eventlet.monkey_patch() + # Monkey patch the original current_thread to use the up-to-date _active + # global variable. See https://bugs.launchpad.net/bugs/1863021 and + # https://github.com/eventlet/eventlet/issues/592 + import __original_module_threading as orig_threading # noqa + import threading # noqa + orig_threading.current_thread.__globals__['_active'] = threading._active