From b46bb7647b9aab23eb024525eaca78187f0a52cd Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 22 Sep 2026 14:58:12 +0100 Subject: [PATCH] operations: fix TestDeleteFatalError, TestDirMoveMoveError and TestDirMoveContext on remotes TestDeleteFatalError set --max-delete before writing its files, so on chunker, which deletes while uploading, the setup failed. TestDirMoveMoveError and TestDirMoveContext test the core DirMove logic with a wrapping Fs. This fails on remotes without Move (eg s3, memory) and on those whose objects don't belong to the wrapped Fs (eg archive), so they now only run on local. (cherry picked from commit ff958c999fdca75490cd8a8e7965a41ee18733e0) --- fs/operations/operations_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fs/operations/operations_test.go b/fs/operations/operations_test.go index db5ba0129..a78454aaf 100644 --- a/fs/operations/operations_test.go +++ b/fs/operations/operations_test.go @@ -430,12 +430,13 @@ func TestDeleteFatalError(t *testing.T) { ctx := context.Background() ctx, ci := fs.AddConfig(ctx) ci.Checkers = 2 - ci.MaxDelete = 1 r := fstest.NewRun(t) // More files than the deleters' channel can hold for i := range 20 { r.WriteObject(ctx, fmt.Sprintf("file%d", i), "x", t1) } + // Set after writing the files as some backends (eg chunker) delete while uploading + ci.MaxDelete = 1 done := make(chan error, 1) go func() { @@ -1461,6 +1462,11 @@ type noDirMoveFs struct { func (f *noDirMoveFs) Features() *fs.Features { return f.features } func newNoDirMoveFs(t *testing.T, wrapped fs.Fs, failOn string) *noDirMoveFs { + // This tests the core DirMove logic, and on other backends the + // objects may not belong to wrapped or there may be no Move. + if *fstest.RemoteName != "" { + t.Skip("Skipping test on non local remote") + } move := wrapped.Features().Move require.NotNil(t, move, "the test needs a backend with Move") f := &noDirMoveFs{