From f998e8d96552d8c0e2d2421a4e2a8583ad2cfffb Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Fri, 1 Sep 2017 13:21:23 -0700 Subject: [PATCH] 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 --- neutron/tests/fullstack/test_l3_agent.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/neutron/tests/fullstack/test_l3_agent.py b/neutron/tests/fullstack/test_l3_agent.py index fcb5a62505f..087a53ac7fd 100644 --- a/neutron/tests/fullstack/test_l3_agent.py +++ b/neutron/tests/fullstack/test_l3_agent.py @@ -232,9 +232,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(