Skip to content

Commit

Permalink
vfs: increase time to wait for writers in tests to 30s
Browse files Browse the repository at this point in the history
In some backends (eg putio) this deadline was consistently missed at
10s so this patch increases it to 30s.

See: rclone#5734
  • Loading branch information
ncw committed Oct 20, 2021
1 parent 1eff0ee commit 72c013c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion vfs/vfs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var (
// Constants uses in the tests
const (
writeBackDelay = 100 * time.Millisecond // A short writeback delay for testing
waitForWritersDelay = 10 * time.Second // time to wait for existing writers
waitForWritersDelay = 30 * time.Second // time to wait for existing writers
)

// TestMain drives the tests
Expand Down
8 changes: 6 additions & 2 deletions vfs/vfstest/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ import (
"github.com/stretchr/testify/require"
)

const (
waitForWritersDelay = 30 * time.Second // time to wait for existing writers
)

var (
mountFn mountlib.MountFn
)
Expand Down Expand Up @@ -227,7 +231,7 @@ func (r *Run) cacheMode(cacheMode vfscommon.CacheMode, writeBack time.Duration)
return
}
// Wait for writers to finish
r.vfs.WaitForWriters(30 * time.Second)
r.vfs.WaitForWriters(waitForWritersDelay)
// Empty and remake the remote
r.cleanRemote()
err := r.fremote.Mkdir(context.Background(), "")
Expand Down Expand Up @@ -372,7 +376,7 @@ func (r *Run) checkDir(t *testing.T, dirString string) {

// wait for any files being written to be released by fuse
func (r *Run) waitForWriters() {
run.vfs.WaitForWriters(10 * time.Second)
run.vfs.WaitForWriters(waitForWritersDelay)
}

// writeFile writes data to a file named by filename.
Expand Down

0 comments on commit 72c013c

Please sign in to comment.