Skip to content

Commit

Permalink
Extend VM bootup timeout in entropy test (#493)
Browse files Browse the repository at this point in the history
* Extend VM bootup timeout in entropy test
* Fix mirror for debian

Signed-off-by: Matthias Büchse <[email protected]>
  • Loading branch information
mbuechse authored Mar 4, 2024
1 parent 5b2bef1 commit 772e06b
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Tests/iaas/entropy/entropy-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,22 @@


# we need to set package source on Ubuntu, because the default is not fixed and can lead to Heisenbugs
SERVER_USERDATA = """#cloud-config
SERVER_USERDATA = {
'ubuntu': """#cloud-config
apt:
primary:
- arches: [default]
uri: http://az1.clouds.archive.ubuntu.com/ubuntu/
security: []
"""
""",
'debian': """#cloud-config
apt:
primary:
- arches: [default]
uri: https://mirror.plusserver.com/debian/debian/
security: []
""",
}


def print_usage(file=sys.stderr):
Expand Down Expand Up @@ -311,7 +320,7 @@ def create_vm(env, all_flavors, image, server_name=SERVER_NAME):

# try to pick a frugal flavor
flavor = min(flavors, key=lambda flv: flv.vcpus)
userdata = SERVER_USERDATA if image.name.lower().startswith("ubuntu") else None
userdata = next((value for key, value in SERVER_USERDATA.items() if image.name.lower().startswith(key)), None)
# create a server with the image and the flavor as well as
# the previously created keys and security group
logger.debug(f"Creating instance of image '{image.name}' using flavor '{flavor.name}'")
Expand All @@ -331,7 +340,7 @@ def delete_vm(conn, server_name=SERVER_NAME):
logger.debug(f"The server '{server_name}' couldn't be deleted.", exc_info=True)


def retry(func, exc_type, timeouts=(8, 7, 15, 10)):
def retry(func, exc_type, timeouts=(8, 7, 15, 10, 20, 30, 60)):
if isinstance(exc_type, str):
exc_type = exc_type.split(',')
timeout_iter = iter(timeouts)
Expand Down

0 comments on commit 772e06b

Please sign in to comment.