Revert "Restart all L3 agents in test that check no packet loss in HA routers"

Unfortunately it still sometimes fails because restart was still happened in
very short pause between agents.
I will need to figure out some other possible solution for that issue.

This reverts commit bdd3540554.

Change-Id: Iaf9d1be3255e941c5fe227943535ab7c6905253c
This commit is contained in:
Slawek Kaplonski 2019-03-03 13:31:18 +00:00
parent bdd3540554
commit 8f656306f2
2 changed files with 23 additions and 5 deletions

View File

@ -97,13 +97,12 @@ class BaseFullStackTestCase(testlib_api.MySQLTestCaseMixin,
def _assert_ping_during_agents_restart(
self, agents, src_namespace, ips, restart_timeout=10,
ping_timeout=1, count=10, max_workers=None):
max_workers = max_workers or len(agents)
ping_timeout=1, count=10):
with net_helpers.async_ping(
src_namespace, ips, timeout=ping_timeout,
count=count) as done:
LOG.debug("Restarting agents")
executor = futures.ThreadPoolExecutor(max_workers=max_workers)
executor = futures.ThreadPoolExecutor(max_workers=len(agents))
restarts = [agent.restart(executor=executor)
for agent in agents]

View File

@ -318,6 +318,19 @@ class TestHAL3Agent(TestL3Agent):
if self._get_keepalived_state(keepalived_state_file) == "master":
return keepalived_state_file
def _get_l3_agents_with_ha_state(self, l3_agents, router_id, ha_state):
found_agents = []
agents_hosting_router = self.client.list_l3_agent_hosting_routers(
router_id)['agents']
for agent in l3_agents:
agent_host = agent.neutron_cfg_fixture.get_host()
for agent_hosting_router in agents_hosting_router:
if (agent_hosting_router['host'] == agent_host and
agent_hosting_router['ha_state'] == ha_state):
found_agents.append(agent)
break
return found_agents
def test_keepalived_multiple_sighups_does_not_forfeit_mastership(self):
"""Setup a complete "Neutron stack" - both an internal and an external
network+subnet, and a router connected to both.
@ -397,10 +410,16 @@ class TestHAL3Agent(TestL3Agent):
external_vm.block_until_ping(router_ip)
l3_agents = [host.agents['l3'] for host in self.environment.hosts]
l3_standby_agents = self._get_l3_agents_with_ha_state(
l3_agents, router['id'], 'standby')
l3_active_agents = self._get_l3_agents_with_ha_state(
l3_agents, router['id'], 'active')
self._assert_ping_during_agents_restart(
l3_agents, external_vm.namespace, [router_ip], count=60,
max_workers=1)
l3_standby_agents, external_vm.namespace, [router_ip], count=60)
self._assert_ping_during_agents_restart(
l3_active_agents, external_vm.namespace, [router_ip], count=60)
def test_gateway_ip_changed(self):
self._test_gateway_ip_changed()