Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

vfs: increase time to wait for writers in tests to 30s

Nick Craig-Wood72c013c6f415
diff --git a/vfs/vfs_test.go b/vfs/vfs_test.go
index 6a64f5b1b..4ece14c4f 100644
--- a/vfs/vfs_test.go
+++ b/vfs/vfs_test.go
@@ -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
diff --git a/vfs/vfstest/fs.go b/vfs/vfstest/fs.go
index 51b1e59d7..3e7b47a0e 100644
--- a/vfs/vfstest/fs.go
+++ b/vfs/vfstest/fs.go
@@ -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
)
@@ -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(), "")
@@ -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.