mirror of
https://github.com/rclone/rclone.git
synced 2026-10-09 22:45:26 -04:00
FsOpenChunkWriter wrote three chunks of its own fixed sizes whatever ChunkWriterInfo.ChunkSize the backend returned. That happened to be the size the s3 backend uses by default, so the test passed there, but a chunk writer which works out where a chunk goes from its number needs every chunk but the last to be exactly the size it asked for - as a multi-thread copy writes them - and the test could neither exercise nor catch that. Cut the file into chunks of info.ChunkSize, the last one short, still written out of order. Where the backend lets the test set its chunk size, ask for 5 MiB first so the file takes several chunks. Where it doesn't and the chunks leave the file in fewer than three, start again with a file of two full chunks and a short one, for chunks up to 128 MiB.