fstest: don't error out if the target was not found at end of run

This commit is contained in:
Nick Craig-Wood 2017-12-04 15:58:29 +00:00
parent fa4a25a73b
commit ebd7780188
1 changed files with 6 additions and 2 deletions

View File

@ -127,7 +127,7 @@ func NewRun(t *testing.T) *Run {
*r = *oneRun
r.cleanRemote = func() {
var toDelete dirsToRemove
require.NoError(t, fs.Walk(r.Fremote, "", true, -1, func(dirPath string, entries fs.DirEntries, err error) error {
err := fs.Walk(r.Fremote, "", true, -1, func(dirPath string, entries fs.DirEntries, err error) error {
if err != nil {
if err == fs.ErrorDirNotFound {
return nil
@ -146,7 +146,11 @@ func NewRun(t *testing.T) *Run {
}
}
return nil
}))
})
if err == fs.ErrorDirNotFound {
return
}
require.NoError(t, err)
sort.Sort(toDelete)
for _, dir := range toDelete {
err := r.Fremote.Rmdir(dir)