mirror of
https://github.com/rclone/rclone.git
synced 2025-01-03 21:09:18 +01:00
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
This commit is contained in:
parent
1eff0eef7a
commit
72c013c6f4
@ -29,7 +29,7 @@ var (
|
|||||||
// Constants uses in the tests
|
// Constants uses in the tests
|
||||||
const (
|
const (
|
||||||
writeBackDelay = 100 * time.Millisecond // A short writeback delay for testing
|
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
|
// TestMain drives the tests
|
||||||
|
@ -32,6 +32,10 @@ import (
|
|||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
waitForWritersDelay = 30 * time.Second // time to wait for existing writers
|
||||||
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
mountFn mountlib.MountFn
|
mountFn mountlib.MountFn
|
||||||
)
|
)
|
||||||
@ -227,7 +231,7 @@ func (r *Run) cacheMode(cacheMode vfscommon.CacheMode, writeBack time.Duration)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
// Wait for writers to finish
|
// Wait for writers to finish
|
||||||
r.vfs.WaitForWriters(30 * time.Second)
|
r.vfs.WaitForWriters(waitForWritersDelay)
|
||||||
// Empty and remake the remote
|
// Empty and remake the remote
|
||||||
r.cleanRemote()
|
r.cleanRemote()
|
||||||
err := r.fremote.Mkdir(context.Background(), "")
|
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
|
// wait for any files being written to be released by fuse
|
||||||
func (r *Run) waitForWriters() {
|
func (r *Run) waitForWriters() {
|
||||||
run.vfs.WaitForWriters(10 * time.Second)
|
run.vfs.WaitForWriters(waitForWritersDelay)
|
||||||
}
|
}
|
||||||
|
|
||||||
// writeFile writes data to a file named by filename.
|
// writeFile writes data to a file named by filename.
|
||||||
|
Loading…
Reference in New Issue
Block a user