Skip to content

Commit

Permalink
Use s3_get_object with retry (red-hat-storage#8477)
Browse files Browse the repository at this point in the history
Signed-off-by: Sagi Hirshfeld <[email protected]>
  • Loading branch information
sagihirshfeld authored Sep 27, 2023
1 parent 9b09492 commit 8d3a796
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/manage/mcg/test_bucket_policy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import logging
import time

import pytest
import botocore.exceptions as boto3exception
Expand Down Expand Up @@ -52,6 +51,7 @@
red_squad,
)
from ocs_ci.utility import version
from ocs_ci.utility.retry import retry

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -914,15 +914,16 @@ def test_public_website(self, mcg_obj, bucket_factory):
get_policy = get_bucket_policy(mcg_obj, s3_bucket[0].name)
logger.info(f"Bucket policy: {get_policy['Policy']}")

logger.info("Waiting 5 seconds for bucket policy to propagate...")
time.sleep(5)

# Verifying GetObject by reading the index of the website by anonymous users
for user in users:
logger.info(
f"Getting object using user: {user.email_id} on bucket: {s3_bucket[0].name} "
)
assert s3_get_object(
retry_s3_get_object = retry(boto3exception.ClientError, tries=4, delay=10)(
s3_get_object
)

assert retry_s3_get_object(
user, s3_bucket[0].name, "index.html"
), f"Failed: Get Object by user {user.email_id}"

Expand Down

0 comments on commit 8d3a796

Please sign in to comment.