cloud-init-dev team mailing list archive
Mailing list archive
[Merge] ~raharper/cloud-init:fix/cloud-tests-lxd-retry-delete into cloud-init:master
Ryan Harper has proposed merging ~raharper/cloud-init:fix/cloud-tests-lxd-retry-delete into cloud-init:master.
cloud_test/lxd: Retry container delete a few times
LXD integration tests fail sometimes due to failure to delete the
container, usually related to ZFS backend. This is a transient
issue unrelated to the test itself. Teach LXD platform to retry
this a few times before returning an error.
cloud-init Commiters (cloud-init-dev)
For more details, see:
Your team cloud-init Commiters is requested to review the proposed merge of ~raharper/cloud-init:fix/cloud-tests-lxd-retry-delete into cloud-init:master.
diff --git a/tests/cloud_tests/platforms/lxd/instance.py b/tests/cloud_tests/platforms/lxd/instance.py
index 83c97ab..027c1dd 100644
@@ -224,7 +224,17 @@ class LXDInstance(Instance):
LOG.debug("%s: deleting container.", self)
+ retries =  * 5
+ for attempt, wait in enumerate(retries):
+ except Exception:
+ if attempt + 1 >= len(retries):
+ LOG.debug('Failed to delete container %s (%s/%s) retrying...',
+ self, attempt + 1, len(retries))
self._pylxd_container = None