Merge "Support running tests w/eventlet monkey patching"

This commit is contained in:
Zuul 2024-11-23 13:46:20 +00:00 committed by Gerrit Code Review
commit f767d6df1b
4 changed files with 19 additions and 1 deletions

View File

@ -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

View File

@ -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.

View File

@ -0,0 +1,5 @@
import os
if os.environ.get("OSLO_LOG_TEST_EVENTLET") == "1":
import eventlet
eventlet.monkey_patch()

View File

@ -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}