mirror of
https://github.com/rclone/rclone.git
synced 2024-11-07 09:04:52 +01:00
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.
This commit is contained in:
parent
22daeaa6f3
commit
580d72f0f6
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user