mirror of
https://github.com/rclone/rclone
synced 2024-11-26 04:07:22 +01:00
vfs: fix rename tests by waiting for writes to complete
Before this change the background writing of the file was racing with the test of the object on the remote. This meant that the tests passed locally but failed on a lot of the remotes.
This commit is contained in:
parent
6082096f7e
commit
d2ad293fae
@ -16,10 +16,6 @@ vfs/vfscache/downloaders
|
||||
cmd/cmount
|
||||
"
|
||||
|
||||
testdirs="
|
||||
cmd/cmount
|
||||
"
|
||||
|
||||
for testdir in ${testdirs}; do
|
||||
echo "Testing ${testdir}"
|
||||
cd ${base}/${testdir}
|
||||
|
@ -265,9 +265,12 @@ func testFileRename(t *testing.T, mode vfscommon.CacheMode, inCache bool, forceC
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, 14, n)
|
||||
|
||||
require.NoError(t, file.SetModTime(item.ModTime))
|
||||
|
||||
err = fd.Close()
|
||||
require.NoError(t, err)
|
||||
}
|
||||
vfs.WaitForWriters(waitForWritersDelay)
|
||||
|
||||
// check file in cache
|
||||
if inCache {
|
||||
|
Loading…
Reference in New Issue
Block a user