Skip to content

Commit

Permalink
[integ-test] Add retry to solve sporadic rate exceeding errors
Browse files Browse the repository at this point in the history
Signed-off-by: Hanwen <[email protected]>
  • Loading branch information
hanwen-cluster committed Nov 1, 2024
1 parent 824f140 commit 2fd9646
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/integration-tests/tests/createami/test_createami.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def test_build_image(
# Test AMIs from first stage build. Because RHEL/Rocky and Ubuntu have specific requirement of kernel versions.
try:
base_ami = retrieve_latest_ami(region, os, ami_type="first_stage", architecture=architecture)
except IndexError: # If first stage AMI is not available, use official AMI.
except IndexError: # If first stage AMI is not available, use official AMI.
# Therefore, the test tries to succeed at best effort.
logging.info("First stage AMI not available, using official AMI instead.")
base_ami = retrieve_latest_ami(region, os, ami_type="official", architecture=architecture)
Expand Down Expand Up @@ -346,7 +346,9 @@ def _test_export_logs(s3_bucket_factory, image, region):
with tempfile.TemporaryDirectory() as tempdir:
output_file = f"{tempdir}/testfile.tar.gz"
bucket_prefix = "test_prefix"
ret = image.export_logs(bucket=bucket_name, output_file=output_file, bucket_prefix=bucket_prefix)
ret = retry(wait_fixed=seconds(20), stop_max_delay=minutes(10))(image.export_logs)(
bucket=bucket_name, output_file=output_file, bucket_prefix=bucket_prefix
)
assert_that(ret["path"]).contains(output_file)

rexp = rf"{image.image_id}-logs.*/cloudwatch-logs/{get_installed_parallelcluster_base_version()}-1"
Expand Down

0 comments on commit 2fd9646

Please sign in to comment.