From 37d5e75a569e063aa181f440e08ccc9e0cb1567f Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sun, 15 Mar 2020 11:13:27 +0000 Subject: [PATCH] operations: fix --max-transfer test to have a higher threshold Before this change backends which introduce overhead (eg crypt) were failing to upload the first file. This change increases the threshold to 2k to allow the first file to go through even with some overhead but the next file to definitely fail. --- fs/operations/operations_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/operations/operations_test.go b/fs/operations/operations_test.go index e96b03741..3874db845 100644 --- a/fs/operations/operations_test.go +++ b/fs/operations/operations_test.go @@ -1543,8 +1543,9 @@ func TestCopyFileMaxTransfer(t *testing.T) { ctx := context.Background() + const sizeCutoff = 2048 file1 := r.WriteFile("file1", "file1 contents", t1) - file2 := r.WriteFile("file2", "file2 contents...........", t2) + file2 := r.WriteFile("file2", "file2 contents"+string(make([]byte, sizeCutoff)), t2) rfile1 := file1 rfile1.Path = "sub/file1" @@ -1555,7 +1556,7 @@ func TestCopyFileMaxTransfer(t *testing.T) { rfile2c := file2 rfile2c.Path = "sub/file2c" - fs.Config.MaxTransfer = 15 + fs.Config.MaxTransfer = sizeCutoff fs.Config.CutoffMode = fs.CutoffModeHard accounting.Stats(ctx).ResetCounters()