Skip to content

Commit

Permalink
Merge pull request redpanda-data#11632 from VladLazar/fix-s3-bucket-d…
Browse files Browse the repository at this point in the history
…eletion

rptest: fix S3 bucket deletion
  • Loading branch information
Vlad Lazar authored Jun 23, 2023
2 parents 6b18cb6 + 0cb8c59 commit 1e38bb0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 1 addition & 2 deletions tests/rptest/archival/s3_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ def bucket_is_listable():
f"Bucket {name} didn't become visible to ListObjectsvv2 requests")

def empty_and_delete_bucket(self, name, parallel=False):
failed_deletions = self.cloud_storage_client.empty_bucket(
self._si_settings.cloud_storage_bucket, parallel=parallel)
failed_deletions = self.empty_bucket(name, parallel=parallel)

assert len(failed_deletions) == 0
self.delete_bucket(name)
Expand Down
10 changes: 9 additions & 1 deletion tests/rptest/services/redpanda.py
Original file line number Diff line number Diff line change
Expand Up @@ -2844,7 +2844,15 @@ def add_to_started_nodes(self, node):
def clean(self, **kwargs):
super().clean(**kwargs)
if self.cloud_storage_client:
self.delete_bucket_from_si()
try:
self.delete_bucket_from_si()
except Exception as e:
self.logger.error(
f"Failed to remove bucket {self._si_settings.cloud_storage_bucket}."
f" This may cause running out of quota in the cloud env. Please investigate: {e}"
)

raise e

def clean_node(self,
node,
Expand Down

0 comments on commit 1e38bb0

Please sign in to comment.