mirror of
https://github.com/rclone/rclone.git
synced 2026-09-13 23:00:58 -04:00
Add an FsPutRetry integration test which uses the fshttp fault injector to fail the first request carrying upload data, before it is sent, with either a synthetic 500 or a connection reset, and then checks that Put either succeeds with the correct contents or fails cleanly without leaving a corrupt object behind. It runs a single part upload and, for backends implementing SetUploadChunkSizer, a chunked one. This catches backends which retry an upload from a buffer which has already been consumed or returned to the memory pool. Backends which don't use HTTP skip the test. Also check in FsPutRetry and the large upload tests that the number of buffers in use in the global memory pool is unchanged after an upload, to catch backends which leak pooled buffers.