Add check for Error while deleting objects #32
No reviewers
Labels
No labels
P0
P1
P2
P3
good first issue
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-testcases#32
Loading…
Reference in a new issue
No description provided.
Delete branch "EliChin/frostfs-testcases:feature/delete_objects"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Signed-off-by: Liza e.chichindaeva@yadro.com
@ -169,0 +169,4 @@
if not isinstance(s3_client, AwsCliClient):
if "Error" in response:
logger.error("Deletion failed for specific object(s)")
raise
please raise specific error
@ -166,6 +166,10 @@ def delete_object_s3(
def delete_objects_s3(s3_client, bucket: str, object_keys: list):
try:
response = s3_client.delete_objects(Bucket=bucket, Delete=_make_objs_dict(object_keys))
if not isinstance(s3_client, AwsCliClient):
What about boto3 client?
Also, I think it's bad practice to check errors here since we may have negative cases like this one:
https://git.frostfs.info/TrueCloudLab/frostfs-testcases/src/branch/master/pytest_tests/testsuites/services/s3_gate/test_s3_object.py#L531
This test will be broken after such changes.
I think it's a bad practice here to add this check in aaaall separate testcases, so I tried to check it more precisely here so that no problem will be with negative tests.
Is the OBJECT_NOT_FOUND the one and only error which we want to check?
This can be simplified to just:
The must have here is to preserve original error messages in a some way in our exception.
@ -168,1 +168,4 @@
response = s3_client.delete_objects(Bucket=bucket, Delete=_make_objs_dict(object_keys))
if not isinstance(s3_client, AwsCliClient):
if "Error" in response:
logger.error("Deletion failed for specific object(s)")
It would be nice to include error message in logger output
1951d2e898
to962fb6847b
962fb6847b
to10a9d9b707
@ -8,6 +9,7 @@ import allure
import pytest
import urllib3
from botocore.exceptions import ClientError
from frostfs_testlib.resources.common import OBJECT_NOT_FOUND
It's not required anymore
deleted
@ -1,5 +1,6 @@
import logging
import os
import re
It's not required anymore
deleted
10a9d9b707
to91b8fefed6
91b8fefed6
to532d58abc7