Skip to content

Commit b410557

Browse files
Corey Bryantxtrusia
authored andcommitted
Retry assert after service_ips removal
Similar to when an IP has been added to the service_ips earlier in test_configure_ips(), this adds tenacity Retrying after an IP has been removed from the service_ips. (cherry picked from commit 080a715)
1 parent 3be7009 commit b410557

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

  • zaza/openstack/charm_tests/designate_bind

zaza/openstack/charm_tests/designate_bind/tests.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ def test_configure_ips(self):
5555
reraise=True,
5656
stop=stop_after_attempt(10)):
5757
with attempt:
58-
configured_ips = zaza_model.run_on_unit(self.UNIT,
59-
"ip addr")
58+
configured_ips = zaza_model.run_on_unit(self.UNIT, "ip addr")
6059
self.assertIn(self.VIP, configured_ips["Stdout"])
6160

6261
logging.info("Removing service IP configuration from %s unit.",
@@ -65,5 +64,10 @@ def test_configure_ips(self):
6564
zaza_model.set_application_config(self.APPLICATION, config)
6665
zaza_model.wait_for_application_states()
6766

68-
configured_ips = zaza_model.run_on_unit(self.UNIT, "ip addr")
69-
self.assertNotIn(self.VIP, configured_ips["Stdout"])
67+
for attempt in Retrying(wait=wait_fixed(2),
68+
retry=retry_if_exception_type(AssertionError),
69+
reraise=True,
70+
stop=stop_after_attempt(10)):
71+
with attempt:
72+
configured_ips = zaza_model.run_on_unit(self.UNIT, "ip addr")
73+
self.assertNotIn(self.VIP, configured_ips["Stdout"])

0 commit comments

Comments
 (0)