From 6986a43b685dc187731af2382ef914f3a65cc95b Mon Sep 17 00:00:00 2001 From: Dan McArdle Date: Sat, 10 Feb 2024 12:44:17 -0500 Subject: [PATCH] bisync: delete flushCache() function from tests The flushCache() function has a bug that causes it to never actually flush the cache. Specifically, it checks whether DirCacheFlush is nil, but never calls it. The tests are already passing without flushing the dir cache, so this commit just deletes flushCache() and its call sites. Fixes rclone/rclone#7623 --- cmd/bisync/bisync_test.go | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/cmd/bisync/bisync_test.go b/cmd/bisync/bisync_test.go index 288371b7f..e9307d9ce 100644 --- a/cmd/bisync/bisync_test.go +++ b/cmd/bisync/bisync_test.go @@ -532,7 +532,6 @@ func (b *bisyncTest) runTestStep(ctx context.Context, line string) (err error) { if err != nil { return err } - flushCache(fsrc) return case "delete-file": b.checkArgs(args, 1, 1) @@ -769,13 +768,6 @@ func (b *bisyncTest) checkArgs(args []string, min, max int) { } } -func flushCache(f fs.Fs) { - dirCacheFlush := f.Features().DirCacheFlush - if dirCacheFlush == nil { - fs.Errorf(nil, "%v: can't flush dir cache", f) - } -} - func (b *bisyncTest) runBisync(ctx context.Context, args []string) (err error) { opt := &bisync.Options{ Workdir: b.workDir, @@ -789,10 +781,6 @@ func (b *bisyncTest) runBisync(ctx context.Context, args []string) (err error) { octx, ci := fs.AddConfig(ctx) fs1, fs2 := b.fs1, b.fs2 - // flush cache - flushCache(fs1) - flushCache(fs2) - addSubdir := func(path, subdir string) fs.Fs { remote := path + subdir f, err := fs.NewFs(ctx, remote) @@ -968,9 +956,6 @@ func (b *bisyncTest) listSubdirs(ctx context.Context, remote string, DirsOnly bo return err } - // flush cache - flushCache(f) - opt := operations.ListJSONOpt{ NoModTime: true, NoMimeType: true,