mirror of
https://github.com/rclone/rclone.git
synced 2025-12-31 15:43:53 +00:00
mounttest: wait for all background Close/Release after writing a file
The filesystem does a certain amount of things asynchronously waiting for the file to be released after writing it means everything should be in a consistent state.
This commit is contained in:
@@ -304,10 +304,16 @@ func (r *Run) checkDir(t *testing.T, dirString string) {
|
||||
assert.Equal(t, dm, localDm, "expected vs fuse mount")
|
||||
}
|
||||
|
||||
// wait for any files being written to be released by fuse
|
||||
func (r *Run) waitForWriters() {
|
||||
run.vfs.WaitForWriters(10 * time.Second)
|
||||
}
|
||||
|
||||
func (r *Run) createFile(t *testing.T, filepath string, contents string) {
|
||||
filepath = r.path(filepath)
|
||||
err := ioutil.WriteFile(filepath, []byte(contents), 0600)
|
||||
require.NoError(t, err)
|
||||
r.waitForWriters()
|
||||
}
|
||||
|
||||
func (r *Run) readFile(t *testing.T, filepath string) string {
|
||||
|
||||
Reference in New Issue
Block a user