Ensure model starts executing before the wait

There was a race before a block_until_all_units_idle() where it
could blast through the check before it started removing the relation.
This ensures that it waits until something happens and then waits for it
to finish.
This commit is contained in:
Alex Kavanagh
2020-05-14 19:37:45 +01:00
parent 4c2f723332
commit 5d05eb70cc
@@ -86,6 +86,7 @@ class CinderCephMonTest(test_utils.OpenStackBaseTest):
logging.info("Removing ceph-mon:client <-> cinder-ceph:ceph relation")
zaza.model.remove_relation(
"ceph-mon", "ceph-mon:client", "cinder-ceph:ceph")
zaza.model.wait_for_agent_status()
logging.info("Wait till model is idle ...")
zaza.model.block_until_all_units_idle()
@@ -104,6 +105,7 @@ class CinderCephMonTest(test_utils.OpenStackBaseTest):
logging.info("Restoring ceph-mon:client <-> cinder-ceph:ceph relation")
zaza.model.add_relation(
"ceph-mon", "ceph-mon:client", "cinder-ceph:ceph")
zaza.model.wait_for_agent_status()
logging.info("Wait till model is idle ...")
zaza.model.block_until_all_units_idle()
logging.info("... Done.")