summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Schwarz <jschwarz@redhat.com>2016-12-01 11:49:14 +0200
committervenkata anil <anilvenkata@redhat.com>2017-08-14 10:01:31 +0000
commit9429b39512a221da3e61965ec193b9ccbc31c4c4 (patch)
treef26714ebf9c7138d7d29a144b57e6c11d3f9fb9f
parent92689470e146bc20daa04556cd74d6685d0522b5 (diff)
downloadneutron-9429b39512a221da3e61965ec193b9ccbc31c4c4.tar.gz
Functional tests: change assert to wait_until_true
In certain cases, the keepalived can take a few seconds to run/stop. For this reason, the patch proposes a change to the tests, in which instead of asserting that the process started/stopped, we'll wait a short while until they do. This will cause failing tests to not fail simply because it took a few extra CPU cycles to run. Change-Id: I497ef32651fbb68bf49e172543f9675f6279df4b (cherry picked from commit 59bb1ecfb036abf0013d38b39324bf7bcde3b983)
-rw-r--r--neutron/tests/functional/agent/l3/framework.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/neutron/tests/functional/agent/l3/framework.py b/neutron/tests/functional/agent/l3/framework.py
index b8726d3f10..41f1450bbe 100644
--- a/neutron/tests/functional/agent/l3/framework.py
+++ b/neutron/tests/functional/agent/l3/framework.py
@@ -302,14 +302,18 @@ class L3AgentTestFramework(base.BaseSudoTestCase):
if enable_ha:
self._assert_ha_device(router)
- self.assertTrue(router.keepalived_manager.get_process().active)
+ common_utils.wait_until_true(
+ lambda: router.keepalived_manager.get_process().active,
+ timeout=15)
self._delete_router(self.agent, router.router_id)
self._assert_interfaces_deleted_from_ovs()
self._assert_router_does_not_exist(router)
if enable_ha:
- self.assertFalse(router.keepalived_manager.get_process().active)
+ common_utils.wait_until_true(
+ lambda: not router.keepalived_manager.get_process().active,
+ timeout=15)
return return_copy
def manage_router(self, agent, router):