From 580d72f0f68403225e14a97072658a1361f91669 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 10 Mar 2023 12:09:47 +0000 Subject: [PATCH] operations: skip --max-delete tests on chunker integration tests The recent changes to remove race conditions from --max-delete have made these tests fail on chunker with s3 because they do copy then delete and the deletes are being counted in the --max-delete(-size) counts. --- fs/operations/operations_test.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/fs/operations/operations_test.go b/fs/operations/operations_test.go index acced6855..18b7bfc36 100644 --- a/fs/operations/operations_test.go +++ b/fs/operations/operations_test.go @@ -419,6 +419,16 @@ func TestDelete(t *testing.T) { r.CheckRemoteItems(t, file3) } +func isChunker(f fs.Fs) bool { + return strings.HasPrefix(f.Name(), "TestChunker") +} + +func skipIfChunker(t *testing.T, f fs.Fs) { + if isChunker(f) { + t.Skip("Skipping test on chunker backend") + } +} + func TestMaxDelete(t *testing.T) { ctx := context.Background() ctx, ci := fs.AddConfig(ctx) @@ -426,6 +436,7 @@ func TestMaxDelete(t *testing.T) { accounting.GlobalStats().ResetCounters() ci.MaxDelete = 2 defer r.Finalise() + skipIfChunker(t, r.Fremote) // chunker does copy/delete on s3 file1 := r.WriteObject(ctx, "small", "1234567890", t2) // 10 bytes file2 := r.WriteObject(ctx, "medium", "------------------------------------------------------------", t1) // 60 bytes file3 := r.WriteObject(ctx, "large", "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", t1) // 100 bytes @@ -446,6 +457,7 @@ func TestMaxDeleteSizeLargeFile(t *testing.T) { accounting.GlobalStats().ResetCounters() ci.MaxDeleteSize = 70 defer r.Finalise() + skipIfChunker(t, r.Fremote) // chunker does copy/delete on s3 file1 := r.WriteObject(ctx, "small", "1234567890", t2) // 10 bytes file2 := r.WriteObject(ctx, "medium", "------------------------------------------------------------", t1) // 60 bytes file3 := r.WriteObject(ctx, "large", "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", t1) // 100 bytes @@ -463,6 +475,7 @@ func TestMaxDeleteSize(t *testing.T) { accounting.GlobalStats().ResetCounters() ci.MaxDeleteSize = 160 defer r.Finalise() + skipIfChunker(t, r.Fremote) // chunker does copy/delete on s3 file1 := r.WriteObject(ctx, "small", "1234567890", t2) // 10 bytes file2 := r.WriteObject(ctx, "medium", "------------------------------------------------------------", t1) // 60 bytes file3 := r.WriteObject(ctx, "large", "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", t1) // 100 bytes @@ -1825,7 +1838,7 @@ func TestCopyFileMaxTransfer(t *testing.T) { r.CheckLocalItems(t, file1, file2, file3, file4) r.CheckRemoteItems(t, file1) - if strings.HasPrefix(r.Fremote.Name(), "TestChunker") { + if isChunker(r.Fremote) { t.Log("skipping remainder of test for chunker as it involves multiple transfers") return }