diff --git a/.zuul.yaml b/.zuul.yaml index d3410d40..b9a84ee7 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -38,14 +38,23 @@ - ^releasenotes/.*$ - ^\.pre-commit-config\.yaml$ +- job: + name: oslo.log-tox-py312-eventlet-patched + parent: openstack-tox-py312 + vars: + tox_environment: + OSLO_LOG_TEST_EVENTLET: 1 + - project: check: jobs: - oslo.log-src-grenade - oslo.log-jsonformatter + - oslo.log-tox-py312-eventlet-patched gate: jobs: - oslo.log-jsonformatter + - oslo.log-tox-py312-eventlet-patched templates: - check-requirements - lib-forward-testing-python3 diff --git a/oslo_log/pipe_mutex.py b/oslo_log/pipe_mutex.py index 84884cfa..3751e768 100644 --- a/oslo_log/pipe_mutex.py +++ b/oslo_log/pipe_mutex.py @@ -15,13 +15,15 @@ import errno import fcntl -import os import eventlet import eventlet.debug import eventlet.greenthread import eventlet.hubs +# We want the blocking APIs, because we set file descriptors to non-blocking. +os = eventlet.patcher.original("os") + class PipeMutex: """Mutex using a pipe. diff --git a/oslo_log/tests/__init__.py b/oslo_log/tests/__init__.py index e69de29b..f670b8fc 100644 --- a/oslo_log/tests/__init__.py +++ b/oslo_log/tests/__init__.py @@ -0,0 +1,5 @@ +import os + +if os.environ.get("OSLO_LOG_TEST_EVENTLET") == "1": + import eventlet + eventlet.monkey_patch() diff --git a/tox.ini b/tox.ini index 29a8963e..0375cc6c 100644 --- a/tox.ini +++ b/tox.ini @@ -7,9 +7,11 @@ ignore_basepython_conflict = true basepython = python3 allowlist_externals = find + env deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/test-requirements.txt +passenv = OSLO_LOG_TEST_EVENTLET commands = find . -type f -name "*.pyc" -delete stestr run {posargs}