forked from TrueCloudLab/rclone
mounttest: wait for files to disappear from the directory listing
This commit is contained in:
parent
b21f227bd3
commit
00b46a8b96
1 changed files with 10 additions and 0 deletions
|
@ -338,6 +338,16 @@ func (r *Run) rm(t *testing.T, filepath string) {
|
|||
filepath = r.path(filepath)
|
||||
err := os.Remove(filepath)
|
||||
require.NoError(t, err)
|
||||
|
||||
// Wait for file to disappear from listing
|
||||
for i := 0; i < 10; i++ {
|
||||
_, err := os.Stat(filepath)
|
||||
if os.IsNotExist(err) {
|
||||
return
|
||||
}
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
}
|
||||
assert.Fail(t, "failed to delete file", filepath)
|
||||
}
|
||||
|
||||
func (r *Run) rmdir(t *testing.T, filepath string) {
|
||||
|
|
Loading…
Reference in a new issue