mirror of
https://github.com/rclone/rclone
synced 2024-11-25 02:47:14 +01:00
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
This commit is contained in:
parent
11c6489fd1
commit
6986a43b68
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user