Browse Source

Enhance agent's resources_synced check

The fullstack test TestPlacementBandwidthReport.
test_configurations_are_synced_towards_placement sporadically failing
and one possible reason is that multiple agents are visible to the
server after restart of the agent (perhaps due to parallel execution).

Partial-Bug: #1862177
Change-Id: I79aa2cb9bcd69fc0cb35e0fd351a373e00feb062
tags/16.0.0.0b1
elajkat 9 months ago
parent
commit
c9a3d49513
1 changed files with 9 additions and 4 deletions
  1. +9
    -4
      neutron/tests/fullstack/test_agent_bandwidth_report.py

+ 9
- 4
neutron/tests/fullstack/test_agent_bandwidth_report.py View File

@@ -215,16 +215,21 @@ class TestPlacementBandwidthReport(base.BaseFullStackTestCase):
return not self._check_agent_synced()

def _check_agent_synced(self):
agents = self.client.list_agents()
if (len(agents['agents']) == 1 and
agents['agents'][0]['resources_synced']):
return True
agents = self.client.list_agents(agent_type=self.l2_agent_type)
for agent in agents['agents']:
if (agent['id'] == self.original_agent_id and
agent['resources_synced']):
return True
return False

def test_configurations_are_synced_towards_placement(self):
neutron_config = self.environment.hosts[0].l2_agent.neutron_config
report_interval = int(neutron_config['agent']['report_interval'])

agents = self.client.list_agents(agent_type=self.l2_agent_type)
self.assertEqual(1, len(agents['agents']))
self.original_agent_id = agents['agents'][0]['id']

check_agent_synced = functools.partial(self._check_agent_synced)
utils.wait_until_true(
predicate=check_agent_synced,


Loading…
Cancel
Save