Skip to content

Commit

Permalink
Adds delay before calling delete bucket operation to avoid intermitte…
Browse files Browse the repository at this point in the history
…nt BucketNotEmpty error

Signed-off-by: Uday Kurundwade <[email protected]>
  • Loading branch information
udaysk23 committed Jan 10, 2025
1 parent 628f60b commit bde705d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ocs_ci/ocs/resources/objectbucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,11 +483,18 @@ def internal_delete(self):
for obj_version in self.s3resource.Bucket(
self.name
).object_versions.all():
logger.info(1111111111)
logger.info(obj_version.key)
logger.info(obj_version.version_id)
logger.info(2222222222)
obj_version.delete()

else:
self.s3resource.Bucket(self.name).objects.all().delete()
if any("scale" in mark for mark in get_current_test_marks()):
sleep(1800)
# Wait for 60 seconds after calling delete object API
sleep(60)
self.s3resource.Bucket(self.name).delete()
except botocore.exceptions.ClientError as e:
if e.response["Error"]["Code"] == "NoSuchBucket":
Expand Down

0 comments on commit bde705d

Please sign in to comment.