Skip to content

Commit f623b3f

Browse files
committed
[CR] Put all "const ...ContentLength..." together and document them
1 parent 02411e1 commit f623b3f

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

esti/s3_gateway_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,6 @@ func TestS3HeadBucket(t *testing.T) {
329329
}
330330

331331
func TestS3CopyObjectMultipart(t *testing.T) {
332-
const minDataContentLengthForMultipart = 5 << 20
333332
ctx, _, repo := setupTest(t)
334333
defer tearDownTest(repo)
335334

esti/system_test.go

+14-5
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,20 @@ func deleteRepositoryIfAskedTo(ctx context.Context, repositoryName string) {
144144
}
145145
}
146146

147-
const randomDataContentLength = 16
148-
149-
// largeDataContentLength is >5 MiB, which is large enough to require
150-
// multipart operations.
151-
const largeDataContentLength = 6 << 20
147+
const (
148+
// randomDataContentLength is the content length used for small
149+
// objects. It is intentionally not a round number.
150+
randomDataContentLength = 16
151+
152+
// minDataContentLengthForMultipart is the content length for all
153+
// parts of a multipart upload except the last. Its value -- 5MiB
154+
// -- is defined in the S3 protocol, and cannot be changed.
155+
minDataContentLengthForMultipart = 5 << 20
156+
157+
// largeDataContentLength is >minDataContentLengthForMultipart,
158+
// which is large enough to require multipart operations.
159+
largeDataContentLength = 6 << 20
160+
)
152161

153162
func uploadFileRandomDataAndReport(ctx context.Context, repo, branch, objPath string, direct bool) (checksum, content string, err error) {
154163
objContent := randstr.String(randomDataContentLength)

0 commit comments

Comments
 (0)