Skip to content

Commit

Permalink
Retry seed loading in case snap is not ready yet (#925)
Browse files Browse the repository at this point in the history
  • Loading branch information
bschimke95 authored Jan 7, 2025
1 parent 4cdc3cf commit 94d97dd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/integration/tests/test_util/harness/lxd.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,11 @@ def new_instance(self, network_type: str = "IPv4") -> Instance:
except subprocess.CalledProcessError as e:
raise HarnessError(f"Failed to create LXD container {instance_id}") from e

self.exec(instance_id, ["snap", "wait", "system", "seed.loaded"])
return Instance(self, instance_id)
instance = Instance(self, instance_id)
stubbornly(retries=3, delay_s=5).on(instance).exec(
["snap", "wait", "system", "seed.loaded"]
)
return instance

def _configure_profile(self, profile_name: str, profile_config: str):
LOG.debug("Checking for LXD profile %s", profile_name)
Expand Down

0 comments on commit 94d97dd

Please sign in to comment.