Fix Octavia reboot amphora compute node test

Octavia reboot_amphora_compute_node test fails with
MismatchError: 0 != -1: Missing replies from -1 members.

This patch fixes the reboot_amphora_compute_node test by reducing
the requests_count.

When requests_count*members_count is bigger then 1, the LB will assign
traffic to other members when using RoundRobin algorithm, and
evaluation of the members balance might be interfered when only one
member is supposed to receive all traffic.

Change-Id: I719a9e6f6db6d147a54a9245cf3f870495b2e40d
This commit is contained in:
Omer 2022-03-03 17:12:48 +01:00 committed by Federico Ressi
parent 5f45086265
commit 0d0fe3f21c
2 changed files with 41 additions and 14 deletions

View File

@ -134,7 +134,8 @@ def get_master_amphora(amphorae, ip_address, lb_port, lb_protocol,
ip_address=ip_address,
protocol=lb_protocol,
port=lb_port,
members_count=1)
members_count=1,
requests_count=1)
# The amphora which has total_connections > 0 is the master.
for amphora in amphorae:

View File

@ -21,6 +21,7 @@ import tobiko
from tobiko.openstack import keystone
from tobiko.openstack import octavia
from tobiko.openstack import stacks
from tobiko.shell import sh
from tobiko import tripleo
@ -61,13 +62,25 @@ class OctaviaBasicFaultTest(testtools.TestCase):
self.listener_stack.wait_for_members_to_be_reachable()
# Send traffic
octavia.check_members_balanced(
pool_id=self.listener_stack.pool_id,
ip_address=self.loadbalancer_stack.floating_ip_address,
lb_algorithm=self.listener_stack.lb_algorithm,
protocol=self.listener_stack.lb_protocol,
port=self.listener_stack.lb_port)
# For 5 minutes we ignore specific exceptions as we know
# that Octavia resources are being provisioned
for attempt in tobiko.retry(timeout=300.):
try:
octavia.check_members_balanced(
pool_id=self.listener_stack.pool_id,
ip_address=self.loadbalancer_stack.floating_ip_address,
lb_algorithm=self.listener_stack.lb_algorithm,
protocol=self.listener_stack.lb_protocol,
port=self.listener_stack.lb_port)
break
except (octavia.RoundRobinException,
octavia.TrafficTimeoutError,
sh.ShellCommandFailed):
LOG.exception(f"Traffic didn't reach all members after "
f"#{attempt.number} attempts and "
f"{attempt.elapsed_time} seconds")
if attempt.is_last:
raise
def test_reboot_amphora_compute_node(self):
amphora_compute_host = octavia.get_amphora_compute_node(
@ -102,9 +115,22 @@ class OctaviaBasicFaultTest(testtools.TestCase):
self.listener_stack.wait_for_active_members()
# Verify Octavia functionality
octavia.check_members_balanced(
pool_id=self.listener_stack.pool_id,
ip_address=self.loadbalancer_stack.floating_ip_address,
lb_algorithm=self.listener_stack.lb_algorithm,
protocol=self.listener_stack.lb_protocol,
port=self.listener_stack.lb_port)
# For 5 minutes we ignore specific exceptions as we know
# that Octavia resources are being provisioned/migrated
for attempt in tobiko.retry(timeout=300.):
try:
octavia.check_members_balanced(
pool_id=self.listener_stack.pool_id,
ip_address=self.loadbalancer_stack.floating_ip_address,
lb_algorithm=self.listener_stack.lb_algorithm,
protocol=self.listener_stack.lb_protocol,
port=self.listener_stack.lb_port)
break
except (octavia.RoundRobinException,
octavia.TrafficTimeoutError,
sh.ShellCommandFailed):
LOG.exception(f"Traffic didn't reach all members after "
f"#{attempt.number} attempts and "
f"{attempt.elapsed_time} seconds")
if attempt.is_last:
raise