Fix request interval in _wait_for_lb_functional
The request_interval parameter is passed to the _wait_for_lb_functional
function but it wasn't used in the function.
Now the function sleeps for request_interval sec for each iteration of
the loop.
It mitigates some random failures with the TCP listener +
least_connection lb_algorithm tests that require a specific delay
between the requests [0]
[0] https://opendev.org/openstack/octavia-tempest-plugin/src/branch/master/octavia_tempest_plugin/tests/scenario/v2/test_traffic_ops.py#L854
Closes-Bug: PRODX-31486
Change-Id: Idf0a9fb71178abea732748f92f01eed5a55a3228
diff --git a/octavia_tempest_plugin/tests/validators.py b/octavia_tempest_plugin/tests/validators.py
index 5afe28a..b356f62 100644
--- a/octavia_tempest_plugin/tests/validators.py
+++ b/octavia_tempest_plugin/tests/validators.py
@@ -382,7 +382,7 @@
def _wait_for_lb_functional(
self, vip_address, traffic_member_count, protocol_port, protocol,
HTTPS_verify, client_cert_path=None, CA_certs_path=None,
- request_interval=2, request_timeout=10, requests_session=None,
+ request_interval=1, request_timeout=10, requests_session=None,
source_port=None):
start = time.time()
response_counts = {}
@@ -412,7 +412,7 @@
return
except Exception:
LOG.warning('Server is not passing initial traffic. Waiting.')
- time.sleep(1)
+ time.sleep(request_interval)
LOG.debug('Loadbalancer wait for load balancer response totals: %s',
response_counts)