Skip to content

Commit a9538d3

Browse files
authored
tests: test S3 multipart with >10 parts (#1158)
2 parents 105695a + 3fb40ca commit a9538d3

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

neofs-testlib/neofs_testlib/env/templates/neofs_env_config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ binaries:
2626

2727
neofs_s3_gw:
2828
repo: 'nspcc-dev/neofs-s3-gw'
29-
version: 'v0.41.0'
29+
version: 'v0.41.2'
3030
file: 'neofs-s3-gw-{{ arch }}'
3131

3232
neofs_s3_authmate:
3333
repo: 'nspcc-dev/neofs-s3-gw'
34-
version: 'v0.41.0'
34+
version: 'v0.41.2'
3535
file: 'neofs-s3-authmate-{{ arch }}'
3636

3737
neofs_rest_gw:

pytest_tests/tests/s3/test_s3_multipart.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,28 +58,24 @@ def test_s3_object_multipart(self):
5858
def test_s3_object_multipart_non_sequential(self):
5959
bucket = s3_bucket.create_bucket_s3(self.s3_client, bucket_configuration="rep-1")
6060
set_bucket_versioning(self.s3_client, bucket, s3_bucket.VersioningStatus.ENABLED)
61-
parts_count = 5
61+
parts_count = 11
6262
file_name_large = generate_file(PART_SIZE * parts_count) # 5Mb - min part
6363
object_key = object_key_from_file_path(file_name_large)
6464
part_files = split_file(file_name_large, parts_count)
6565
parts = []
6666

67-
with allure.step("Upload second part"):
67+
with allure.step("Create multipart upload"):
6868
upload_id = s3_object.create_multipart_upload_s3(self.s3_client, bucket, object_key)
6969
uploads = s3_object.list_multipart_uploads_s3(self.s3_client, bucket)
70-
etag = s3_object.upload_part_s3(self.s3_client, bucket, object_key, upload_id, 2, part_files[1])
71-
parts.append((2, etag))
7270

73-
with allure.step("Upload first part"):
74-
etag = s3_object.upload_part_s3(self.s3_client, bucket, object_key, upload_id, 1, part_files[0])
75-
parts.append((1, etag))
76-
got_parts = s3_object.list_parts_s3(self.s3_client, bucket, object_key, upload_id)
77-
assert len(got_parts) == 2, f"Expected {1} parts, got\n{got_parts}"
71+
with allure.step("Upload all parts in random order"):
72+
part_orders = list(enumerate(part_files, start=1))
73+
random.shuffle(part_orders)
7874

79-
with allure.step("Upload last parts"):
80-
for part_id, file_path in enumerate(part_files[2:], start=3):
75+
for part_id, file_path in part_orders:
8176
etag = s3_object.upload_part_s3(self.s3_client, bucket, object_key, upload_id, part_id, file_path)
8277
parts.append((part_id, etag))
78+
8379
got_parts = s3_object.list_parts_s3(self.s3_client, bucket, object_key, upload_id)
8480
sorted_parts = sorted(parts, key=lambda x: x[0])
8581
s3_object.complete_multipart_upload_s3(self.s3_client, bucket, object_key, upload_id, sorted_parts)

0 commit comments

Comments
 (0)