Use time.sleep() instead of eventlet.sleep() 52/74952/1
authorCédric Ollivier <cedric.ollivier@orange.com>
Thu, 21 Aug 2025 10:30:35 +0000 (12:30 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Mon, 29 Sep 2025 08:20:50 +0000 (10:20 +0200)
https://opendev.org/openstack/python-cinderclient/commit/9df662e053a42afa667706d542f2896e288d69ab
https://gibizer.github.io/posts/Eventlet-Removal-The-First-Threading-Bug/

Change-Id: I440adc104d43e0b1077100701767695ac53593eb
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
docker/core/9df662e053.patch [new file with mode: 0644]
docker/core/Dockerfile
docs/testing/user/configguide/configguide.rst

diff --git a/docker/core/9df662e053.patch b/docker/core/9df662e053.patch
new file mode 100644 (file)
index 0000000..5124ba3
--- /dev/null
@@ -0,0 +1,37 @@
+From 9df662e053a42afa667706d542f2896e288d69ab Mon Sep 17 00:00:00 2001
+From: Cyril Roelandt <cyril@redhat.com>
+Date: Tue, 12 Nov 2024 23:01:12 +0100
+Subject: [PATCH] Use time.sleep() instead of eventlet.sleep()
+
+In a patched environment, time.sleep will be eventlet.sleep, so this
+does not have any actual impact, but it removes one direct dependency on
+eventlet.
+
+Change-Id: I54112d061fa8118a9a6d91abf07442d8834425b5
+---
+ cinderclient/client.py | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/cinderclient/client.py b/cinderclient/client.py
+index c99a2e7a6..f065c9fc9 100644
+--- a/cinderclient/client.py
++++ b/cinderclient/client.py
+@@ -25,6 +25,7 @@ import logging
+ import os
+ import pkgutil
+ import re
++from time import sleep
+ import urllib
+ from urllib import parse as urlparse
+@@ -42,10 +43,6 @@ from cinderclient import api_versions
+ from cinderclient import exceptions
+ import cinderclient.extension
+-try:
+-    from eventlet import sleep
+-except ImportError:
+-    from time import sleep
+ try:
+     osprofiler_web = importutils.try_import("osprofiler.web")
index 786fc7e..8697e0e 100644 (file)
@@ -5,6 +5,7 @@ ARG OPENSTACK_TAG=unmaintained/zed
 
 COPY Switch-to-threading.Thread-for-Rally-tasks.patch /tmp/Switch-to-threading.Thread-for-Rally-tasks.patch
 COPY Create-new-server-in-test_create_backup.patch /tmp/Create-new-server-in-test_create_backup.patch
+COPY 9df662e053.patch /tmp/9df662e053.patch
 RUN apk -U upgrade && \
     apk --no-cache add --update \
         python3 py3-wheel libffi openssl libjpeg-turbo py3-pip bash \
@@ -34,6 +35,7 @@ RUN apk -U upgrade && \
     pip3 install --use-deprecated=legacy-resolver --no-cache-dir --src /src -c/src/functest/upper-constraints.txt -c/src/requirements/upper-constraints.txt \
         -e /src/functest && \
     (cd /src/rally && patch -p1 < /tmp/Switch-to-threading.Thread-for-Rally-tasks.patch) && \
+    (cd /usr/lib/python3.10/site-packages/cinderclient && patch -p2 < /tmp/9df662e053.patch) && \
     sed -i -E /#egg=rally/d /src/functest/upper-constraints.txt && \
     sed -i -E /#egg=tempest/d /src/functest/upper-constraints.txt && \
     (cd /src/tempest && \
@@ -42,7 +44,7 @@ RUN apk -U upgrade && \
         patch -p1 < /tmp/Create-new-server-in-test_create_backup.patch && \
         git commit -a -m "Backport critical bugfixes" && \
         rm ~/.gitconfig) && \
-    rm -r /src/requirements/.git /src/functest/.git \
+    rm -r /src/requirements/.git /src/functest/.git /tmp/9df662e053.patch \
         /tmp/Switch-to-threading.Thread-for-Rally-tasks.patch \
         /tmp/Create-new-server-in-test_create_backup.patch && \
     mkdir -p /etc/xtesting && \
index 24c297c..f6ce726 100644 (file)
@@ -102,7 +102,7 @@ Run smoke suite::
   sudo docker run --env-file env \
       -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/env_file \
       -v $(pwd)/images:/home/opnfv/functest/images \
-      opnfv/functest-smoke
+      opnfv/functest-smoke:yoga
 
 Results shall be displayed as follows::
 
@@ -140,7 +140,7 @@ Run smoke-cntt suite::
   sudo docker run --env-file env \
       -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/env_file \
       -v $(pwd)/images:/home/opnfv/functest/images \
-      opnfv/functest-smoke-cntt
+      opnfv/functest-smoke-cntt:yoga
 
 Results shall be displayed as follows::
 
@@ -165,7 +165,7 @@ Run benchmarking suite::
   sudo docker run --env-file env \
       -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/env_file \
       -v $(pwd)/images:/home/opnfv/functest/images \
-      opnfv/functest-benchmarking
+      opnfv/functest-benchmarking:yoga
 
 Results shall be displayed as follows::
 
@@ -189,7 +189,7 @@ Run benchmarking-cntt suite::
   sudo docker run --env-file env \
       -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/env_file \
       -v $(pwd)/images:/home/opnfv/functest/images \
-      opnfv/functest-benchmarking-cntt
+      opnfv/functest-benchmarking-cntt:yoga
 
 Results shall be displayed as follows::
 
@@ -210,7 +210,7 @@ Run vnf suite::
   sudo docker run --env-file env \
       -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/env_file \
       -v $(pwd)/images:/home/opnfv/functest/images \
-      opnfv/functest-vnf
+      opnfv/functest-vnf:yoga
 
 Results shall be displayed as follows::