forked from TrueCloudLab/rclone
vfs: vfscache make TestCacheCleaner test more reliable
This commit is contained in:
parent
530dc77cde
commit
939860eb85
1 changed files with 7 additions and 2 deletions
|
@ -565,9 +565,14 @@ func TestCacheCleaner(t *testing.T) {
|
||||||
assert.Equal(t, fmt.Sprintf("%p", potato), fmt.Sprintf("%p", potato2))
|
assert.Equal(t, fmt.Sprintf("%p", potato), fmt.Sprintf("%p", potato2))
|
||||||
assert.True(t, found)
|
assert.True(t, found)
|
||||||
|
|
||||||
time.Sleep(10 * opt.CachePollInterval)
|
for i := 0; i < 100; i++ {
|
||||||
|
time.Sleep(10 * opt.CachePollInterval)
|
||||||
|
potato2, found = c.get("potato")
|
||||||
|
if !found {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
potato2, found = c.get("potato")
|
|
||||||
assert.NotEqual(t, fmt.Sprintf("%p", potato), fmt.Sprintf("%p", potato2))
|
assert.NotEqual(t, fmt.Sprintf("%p", potato), fmt.Sprintf("%p", potato2))
|
||||||
assert.False(t, found)
|
assert.False(t, found)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue