mirror of
https://github.com/rclone/rclone.git
synced 2024-11-23 00:43:49 +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
|
cmd/cmount
|
||||||
"
|
"
|
||||||
|
|
||||||
testdirs="
|
|
||||||
cmd/cmount
|
|
||||||
"
|
|
||||||
|
|
||||||
for testdir in ${testdirs}; do
|
for testdir in ${testdirs}; do
|
||||||
echo "Testing ${testdir}"
|
echo "Testing ${testdir}"
|
||||||
cd ${base}/${testdir}
|
cd ${base}/${testdir}
|
||||||
|
@ -265,9 +265,12 @@ func testFileRename(t *testing.T, mode vfscommon.CacheMode, inCache bool, forceC
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, 14, n)
|
require.Equal(t, 14, n)
|
||||||
|
|
||||||
|
require.NoError(t, file.SetModTime(item.ModTime))
|
||||||
|
|
||||||
err = fd.Close()
|
err = fd.Close()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
}
|
}
|
||||||
|
vfs.WaitForWriters(waitForWritersDelay)
|
||||||
|
|
||||||
// check file in cache
|
// check file in cache
|
||||||
if inCache {
|
if inCache {
|
||||||
|
Loading…
Reference in New Issue
Block a user