"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
lib/pool: fix flaky test which was causing timeouts
Nick Craig-Wood8c37a9c2ef17
diff --git a/lib/pool/pool_test.go b/lib/pool/pool_test.goindex 254ac01f2..0be3e2400 100644--- a/lib/pool/pool_test.go+++ b/lib/pool/pool_test.go@@ -16,16 +16,23 @@ import (// makes the allocations be unreliablefunc makeUnreliable(bp *Pool) {+ const maxFailsInARow = 10+ var allocFails intbp.alloc = func(size int) ([]byte, error) {- if rand.Intn(3) != 0 {+ if rand.Intn(3) != 0 && allocFails < maxFailsInARow {+ allocFails++return nil, errors.New("failed to allocate memory")}+ allocFails = 0return make([]byte, size), nil}+ var freeFails intbp.free = func(b []byte) error {- if rand.Intn(3) != 0 {+ if rand.Intn(3) != 0 && freeFails < maxFailsInARow {+ freeFails++return errors.New("failed to free memory")}+ freeFails = 0return nil}}