From 72c013c6f4156e1ae9deafbc36c270102e291c87 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 20 Oct 2021 17:24:58 +0100 Subject: [PATCH] vfs: increase time to wait for writers in tests to 30s In some backends (eg putio) this deadline was consistently missed at 10s so this patch increases it to 30s. See: #5734 --- vfs/vfs_test.go | 2 +- vfs/vfstest/fs.go | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) 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.