test_ha_router: wait until two agents are scheduled

We need to give some time to neutron-server to schedule the router to
both agents. This reflects what other fullstack test cases do.

Change-Id: I3bce907262635c76b5444fab480f7157172e77a2
Closes-Bug: #1667055
(cherry picked from commit f998e8d965)
This commit is contained in:
Ihar Hrachyshka 2017-09-01 13:21:23 -07:00
parent f475a327b6
commit 11fd7b3553
1 changed files with 6 additions and 3 deletions

View File

@ -209,9 +209,12 @@ class TestHAL3Agent(TestL3Agent):
tenant_id = uuidutils.generate_uuid()
router = self.safe_client.create_router(tenant_id, ha=True)
agents = self.client.list_l3_agent_hosting_routers(router['id'])
self.assertEqual(2, len(agents['agents']),
'HA router must be scheduled to both nodes')
common_utils.wait_until_true(
lambda:
len(self.client.list_l3_agent_hosting_routers(
router['id'])['agents']) == 2,
timeout=90)
common_utils.wait_until_true(
functools.partial(