Merge "Align tests with monkey patch original current_thread _active"
This commit is contained in:
commit
ce6262437d
|
@ -25,3 +25,10 @@ if os.name == 'nt':
|
||||||
eventlet.monkey_patch(os=False, thread=False)
|
eventlet.monkey_patch(os=False, thread=False)
|
||||||
else:
|
else:
|
||||||
eventlet.monkey_patch()
|
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
|
||||||
|
|
|
@ -125,6 +125,12 @@ class Server(service.ServiceBase):
|
||||||
|
|
||||||
def run(port_queue, workers=3, process_time=0):
|
def run(port_queue, workers=3, process_time=0):
|
||||||
eventlet.patcher.monkey_patch()
|
eventlet.patcher.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
|
||||||
|
|
||||||
def hi_app(environ, start_response):
|
def hi_app(environ, start_response):
|
||||||
# Some requests need to take time to process so the connection
|
# Some requests need to take time to process so the connection
|
||||||
|
|
Loading…
Reference in New Issue