fstests: fix maximum tested size in TestFsPutChunked

Before this it was possible hat maxChunkSize was incorrectly set to 200.
This commit is contained in:
Fabian Möller 2018-10-16 11:49:32 +02:00
parent 67703a73de
commit 15ce0ae57c

View file

@ -540,16 +540,13 @@ func Run(t *testing.T, opt *Opt) {
minChunkSize = opt.ChunkedUpload.CeilChunkSize(minChunkSize)
}
maxChunkSize := opt.ChunkedUpload.MaxChunkSize
if maxChunkSize < minChunkSize {
if minChunkSize <= fs.MebiByte {
maxChunkSize = 2 * fs.MebiByte
} else {
maxChunkSize = 2 * minChunkSize
}
} else if maxChunkSize >= 2*minChunkSize {
maxChunkSize := 2 * fs.MebiByte
if maxChunkSize < 2*minChunkSize {
maxChunkSize = 2 * minChunkSize
}
if opt.ChunkedUpload.MaxChunkSize > 0 && maxChunkSize > opt.ChunkedUpload.MaxChunkSize {
maxChunkSize = opt.ChunkedUpload.MaxChunkSize
}
if opt.ChunkedUpload.CeilChunkSize != nil {
maxChunkSize = opt.ChunkedUpload.CeilChunkSize(maxChunkSize)
}